mirror of https://github.com/tasks/tasks
Displaying the activity in most of its awesomeness
parent
040aca6d7c
commit
29c41bcffe
@ -0,0 +1,47 @@
|
|||||||
|
package com.todoroo.astrid.calls;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
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.utility.AndroidUtilities;
|
||||||
|
import com.todoroo.astrid.service.ThemeService;
|
||||||
|
|
||||||
|
public class MissedCallActivity extends Activity {
|
||||||
|
|
||||||
|
public static final String EXTRA_NUMBER = "number"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
private final OnClickListener dismissListener = new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
finish();
|
||||||
|
AndroidUtilities.callOverridePendingTransition(MissedCallActivity.this, 0, android.R.anim.fade_out);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
setContentView(R.layout.missed_call_activity);
|
||||||
|
int color = ThemeService.getThemeColor();
|
||||||
|
|
||||||
|
TextView returnCallButton = (TextView) findViewById(R.id.call_return);
|
||||||
|
TextView addTaskButton = (TextView) findViewById(R.id.call_add);
|
||||||
|
TextView ignoreButton = (TextView) findViewById(R.id.call_ignore);
|
||||||
|
View dismissView = findViewById(R.id.dismiss);
|
||||||
|
|
||||||
|
Resources r = getResources();
|
||||||
|
returnCallButton.setBackgroundColor(r.getColor(color));
|
||||||
|
addTaskButton.setBackgroundColor(r.getColor(color));
|
||||||
|
|
||||||
|
ignoreButton.setOnClickListener(dismissListener);
|
||||||
|
dismissView.setOnClickListener(dismissListener);
|
||||||
|
|
||||||
|
System.err.println("Should display notification for number: " + getIntent().getStringExtra(EXTRA_NUMBER));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,74 @@
|
|||||||
|
<?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="20dip"
|
||||||
|
android:layout_marginLeft="5dip">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/reminder_title"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="20sp"
|
||||||
|
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="@android:drawable/ic_menu_close_clear_cancel"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<include layout="@layout/astrid_speech_bubble"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/call_return"
|
||||||
|
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="20sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/MCA_return_call"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/call_add"
|
||||||
|
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="20sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/MCA_add_task"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/call_ignore"
|
||||||
|
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="20sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/MCA_ignore"
|
||||||
|
android:background="#707070"/>
|
||||||
|
|
||||||
|
</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_missed_call_view"/>
|
||||||
|
</LinearLayout>
|
Loading…
Reference in New Issue