Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/org/adblockplus/android/AboutDialog.java

Issue 6731909971312640: Issue 1227 - Could not close the info-text (Closed)
Patch Set: Created Nov. 6, 2014, 12:49 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « res/layout/about.xml ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 package org.adblockplus.android; 18 package org.adblockplus.android;
19 19
20 import android.app.Dialog; 20 import android.app.Dialog;
21 import android.content.Context; 21 import android.content.Context;
22 import android.content.pm.PackageInfo; 22 import android.content.pm.PackageInfo;
23 import android.content.pm.PackageManager.NameNotFoundException; 23 import android.content.pm.PackageManager.NameNotFoundException;
24 import android.os.Bundle; 24 import android.os.Bundle;
25 import android.text.Html; 25 import android.text.Html;
26 import android.text.method.LinkMovementMethod; 26 import android.text.method.LinkMovementMethod;
27 import android.view.View;
28 import android.view.View.OnClickListener;
27 import android.view.Window; 29 import android.view.Window;
30 import android.widget.Button;
28 import android.widget.TextView; 31 import android.widget.TextView;
29 32
30 public class AboutDialog extends Dialog 33 public class AboutDialog extends Dialog implements OnClickListener
31 { 34 {
32 private static Context context = null; 35 private static Context context = null;
33 36
34 public AboutDialog(final Context context) 37 public AboutDialog(final Context context)
35 { 38 {
36 super(context); 39 super(context);
37 AboutDialog.context = context; 40 AboutDialog.context = context;
38 } 41 }
39 42
40 @Override 43 @Override
(...skipping 30 matching lines...) Expand all
71 info.append(" "); 74 info.append(" ");
72 info.append(versionCode); 75 info.append(versionCode);
73 info.append("</p>"); 76 info.append("</p>");
74 AdblockPlus.appendRawTextFile(context, info, R.raw.info); 77 AdblockPlus.appendRawTextFile(context, info, R.raw.info);
75 AdblockPlus.appendRawTextFile(context, info, R.raw.legal); 78 AdblockPlus.appendRawTextFile(context, info, R.raw.legal);
76 79
77 // Show text 80 // Show text
78 final TextView tv = (TextView) findViewById(R.id.about_text); 81 final TextView tv = (TextView) findViewById(R.id.about_text);
79 tv.setText(Html.fromHtml(info.toString())); 82 tv.setText(Html.fromHtml(info.toString()));
80 tv.setMovementMethod(LinkMovementMethod.getInstance()); 83 tv.setMovementMethod(LinkMovementMethod.getInstance());
84
85 final Button okButton = (Button) findViewById(R.id.close_about);
86 okButton.setOnClickListener(this);
Felix Dahlke 2014/11/11 09:30:43 Not a particular fan of this pattern, gets messy p
87 }
88
89 @Override
90 public void onClick(View v)
91 {
92 this.dismiss();
81 } 93 }
82 } 94 }
OLDNEW
« no previous file with comments | « res/layout/about.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld