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: Switched to anonymous inner class for OnClickListener Created Nov. 11, 2014, 11:30 a.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;
27 import android.view.Window; 28 import android.view.Window;
29 import android.widget.Button;
28 import android.widget.TextView; 30 import android.widget.TextView;
29 31
30 public class AboutDialog extends Dialog 32 public class AboutDialog extends Dialog
31 { 33 {
32 private static Context context = null; 34 private static Context context = null;
33 35
34 public AboutDialog(final Context context) 36 public AboutDialog(final Context context)
35 { 37 {
36 super(context); 38 super(context);
37 AboutDialog.context = context; 39 AboutDialog.context = context;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 info.append(" "); 73 info.append(" ");
72 info.append(versionCode); 74 info.append(versionCode);
73 info.append("</p>"); 75 info.append("</p>");
74 AdblockPlus.appendRawTextFile(context, info, R.raw.info); 76 AdblockPlus.appendRawTextFile(context, info, R.raw.info);
75 AdblockPlus.appendRawTextFile(context, info, R.raw.legal); 77 AdblockPlus.appendRawTextFile(context, info, R.raw.legal);
76 78
77 // Show text 79 // Show text
78 final TextView tv = (TextView) findViewById(R.id.about_text); 80 final TextView tv = (TextView) findViewById(R.id.about_text);
79 tv.setText(Html.fromHtml(info.toString())); 81 tv.setText(Html.fromHtml(info.toString()));
80 tv.setMovementMethod(LinkMovementMethod.getInstance()); 82 tv.setMovementMethod(LinkMovementMethod.getInstance());
83
84 final Button okButton = (Button) findViewById(R.id.close_about);
85 okButton.setOnClickListener(new View.OnClickListener()
86 {
87 @Override
88 public void onClick(View v)
89 {
90 AboutDialog.this.dismiss();
91 }
92 });
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