mirror of https://github.com/tasks/tasks
More skeleton stuff for reengagement, deferring for design
parent
1150f21f2b
commit
cfcbc468c8
@ -0,0 +1,63 @@
|
|||||||
|
package com.todoroo.astrid.reminders;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.View.OnClickListener;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.timsu.astrid.R;
|
||||||
|
import com.todoroo.andlib.service.DependencyInjectionService;
|
||||||
|
import com.todoroo.andlib.utility.AndroidUtilities;
|
||||||
|
import com.todoroo.andlib.utility.Preferences;
|
||||||
|
import com.todoroo.astrid.service.StartupService;
|
||||||
|
import com.todoroo.astrid.service.ThemeService;
|
||||||
|
|
||||||
|
public class ReengagementActivity extends Activity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
new StartupService().onStartupApplication(this);
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
DependencyInjectionService.getInstance().inject(this);
|
||||||
|
|
||||||
|
setContentView(R.layout.reengagement_activity);
|
||||||
|
|
||||||
|
setUpUi();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setUpUi() {
|
||||||
|
View dismiss1 = findViewById(R.id.dismiss);
|
||||||
|
View dismiss2 = findViewById(R.id.dismiss_button);
|
||||||
|
OnClickListener dismissListener = new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
finish();
|
||||||
|
AndroidUtilities.callOverridePendingTransition(ReengagementActivity.this, 0, android.R.anim.fade_out);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
dismiss1.setOnClickListener(dismissListener);
|
||||||
|
dismiss2.setOnClickListener(dismissListener);
|
||||||
|
|
||||||
|
TextView seeTasksButton = (TextView) findViewById(R.id.see_tasks_button);
|
||||||
|
seeTasksButton.setBackgroundColor(getResources().getColor(ThemeService.getThemeColor()));
|
||||||
|
seeTasksButton.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
((TextView) findViewById(R.id.reminder_title)).setText("TITLE");
|
||||||
|
|
||||||
|
if (!Preferences.getBoolean(R.string.p_rmd_nagging, true)) {
|
||||||
|
findViewById(R.id.missed_calls_speech_bubble).setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
TextView dialogView = (TextView) findViewById(R.id.reminder_message);
|
||||||
|
dialogView.setText(Notifications.getRandomReminder(getResources().getStringArray(R.array.rmd_reengage_dialog_options)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,71 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/reminder_root"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dip"
|
||||||
|
android:layout_marginRight="10dip"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:background="@drawable/reminder_dialog_background">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginTop="5dip"
|
||||||
|
android:layout_marginRight="5dip"
|
||||||
|
android:layout_marginBottom="15dip"
|
||||||
|
android:layout_marginLeft="10dip">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/reminder_title"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="1dip"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/MCA_title"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/dismiss"
|
||||||
|
android:layout_width="25dip"
|
||||||
|
android:layout_height="25dip"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
android:src="@drawable/close_clear_cancel"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/see_tasks_button"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="35dip"
|
||||||
|
android:layout_marginLeft="10dip"
|
||||||
|
android:layout_marginRight="10dip"
|
||||||
|
android:layout_marginBottom="10dip"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/rmd_reengage_see_tasks"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/dismiss_button"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="35dip"
|
||||||
|
android:layout_marginLeft="10dip"
|
||||||
|
android:layout_marginRight="10dip"
|
||||||
|
android:layout_marginBottom="10dip"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/DLG_dismiss"
|
||||||
|
android:background="#707070"/>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/missed_calls_speech_bubble"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<include layout="@layout/astrid_speech_bubble" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
<include layout="@layout/astrid_reengagement_view"/>
|
||||||
|
</LinearLayout>
|
Loading…
Reference in New Issue