mirror of https://github.com/tasks/tasks
Basic logic for welcome and login screens
parent
5ddf619907
commit
13f49304ce
Binary file not shown.
|
After Width: | Height: | Size: 127 KiB |
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- See the file "LICENSE" for the full license governing this code. -->
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
style="@style/Content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView android:id="@+id/welcome_image"
|
||||||
|
android:src="@drawable/welcome_screen"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_weight="1"/>
|
||||||
|
|
||||||
|
<Button android:id="@+id/show_eula"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:text="@string/welcome_show_eula"
|
||||||
|
android:layout_height="45dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_alignParentBottom="true"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
package com.todoroo.astrid.activity;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.View.OnClickListener;
|
||||||
|
import android.view.Window;
|
||||||
|
import android.widget.Button;
|
||||||
|
|
||||||
|
import com.timsu.astrid.R;
|
||||||
|
import com.todoroo.andlib.service.ContextManager;
|
||||||
|
import com.todoroo.andlib.utility.Preferences;
|
||||||
|
import com.todoroo.astrid.actfm.ActFmLoginActivity;
|
||||||
|
|
||||||
|
public class WelcomeScreen extends Activity implements Eula.EulaCallback {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
ContextManager.setContext(this);
|
||||||
|
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
|
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.welcome_screen);
|
||||||
|
|
||||||
|
if(Preferences.getBoolean(Eula.PREFERENCE_EULA_ACCEPTED, false)) {
|
||||||
|
Intent taskListStartup = new Intent(this, TaskListActivity.class);
|
||||||
|
startActivity(taskListStartup);
|
||||||
|
finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Button showEula = (Button) findViewById(R.id.show_eula);
|
||||||
|
showEula.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Eula.showEula(WelcomeScreen.this);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void eulaAccepted() {
|
||||||
|
Intent login = new Intent(this, ActFmLoginActivity.class);
|
||||||
|
login.putExtra(ActFmLoginActivity.KEY_SHOW_LATER_BUTTON, true);
|
||||||
|
startActivity(login);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void eulaRefused() {
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue