Added a dialog custom title style for note dialog

pull/14/head
Tim Su 15 years ago
parent 03684c9f25
commit abb456e0c7

@ -364,7 +364,7 @@
</intent-filter>
</receiver>
<activity android:name="com.todoroo.astrid.notes.NoteViewingActivity"
android:theme="@android:style/Theme.Dialog" />
android:theme="@style/Theme.Dialog" />
<!-- locale -->
<activity android:name="com.todoroo.astrid.locale.LocaleEditAlerts"

@ -5,8 +5,10 @@ import android.os.Bundle;
import android.text.util.Linkify;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import com.timsu.astrid.R;
@ -19,16 +21,25 @@ public class NoteViewingActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.empty_linear_layout);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.dialog_title_bar);
LinearLayout body = (LinearLayout) findViewById(R.id.body);
task = getIntent().getParcelableExtra(NotesActionExposer.EXTRA_TASK);
setTitle(task.getValue(Task.TITLE));
TextView title = (TextView) findViewById(R.id.title);
title.setText(task.getValue(Task.TITLE));
ScrollView scrollView = new ScrollView(this);
TextView linkifiedTextView = new TextView(this);
linkifiedTextView.setText(task.getValue(Task.NOTES) + "\n\n"); //$NON-NLS-1$
Linkify.addLinks(linkifiedTextView, Linkify.ALL);
body.addView(linkifiedTextView);
scrollView.addView(linkifiedTextView);
body.addView(scrollView);
Button ok = new Button(this);
ok.setText(android.R.string.ok);

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/title"
android:text="This is my new title"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textColor="#ffffff"
android:padding="6px"
android:ellipsize="marquee"
android:textSize="24px" />

@ -20,6 +20,14 @@
<item name="android:windowBackground">@null</item>
</style>
<style name="DialogTitleBackground">
<item name="android:background">#323331</item>
</style>
<style name="Theme.Dialog" parent="android:Theme.Dialog">
<item name="android:windowTitleBackgroundStyle">@style/DialogTitleBackground</item>
</style>
<!--=============================================== TaskListActivity == -->
<style name="TextAppearance.TLA_NoItems">

Loading…
Cancel
Save