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

Delta Between Two Patch Sets: src/org/adblockplus/android/AboutDialog.java

Issue 6731909971312640: Issue 1227 - Could not close the info-text (Closed)
Left Patch Set: Created Nov. 6, 2014, 12:49 p.m.
Right 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « res/layout/about.xml ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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.View;
28 import android.view.View.OnClickListener;
29 import android.view.Window; 28 import android.view.Window;
30 import android.widget.Button; 29 import android.widget.Button;
31 import android.widget.TextView; 30 import android.widget.TextView;
32 31
33 public class AboutDialog extends Dialog implements OnClickListener 32 public class AboutDialog extends Dialog
34 { 33 {
35 private static Context context = null; 34 private static Context context = null;
36 35
37 public AboutDialog(final Context context) 36 public AboutDialog(final Context context)
38 { 37 {
39 super(context); 38 super(context);
40 AboutDialog.context = context; 39 AboutDialog.context = context;
41 } 40 }
42 41
43 @Override 42 @Override
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 info.append("</p>"); 75 info.append("</p>");
77 AdblockPlus.appendRawTextFile(context, info, R.raw.info); 76 AdblockPlus.appendRawTextFile(context, info, R.raw.info);
78 AdblockPlus.appendRawTextFile(context, info, R.raw.legal); 77 AdblockPlus.appendRawTextFile(context, info, R.raw.legal);
79 78
80 // Show text 79 // Show text
81 final TextView tv = (TextView) findViewById(R.id.about_text); 80 final TextView tv = (TextView) findViewById(R.id.about_text);
82 tv.setText(Html.fromHtml(info.toString())); 81 tv.setText(Html.fromHtml(info.toString()));
83 tv.setMovementMethod(LinkMovementMethod.getInstance()); 82 tv.setMovementMethod(LinkMovementMethod.getInstance());
84 83
85 final Button okButton = (Button) findViewById(R.id.close_about); 84 final Button okButton = (Button) findViewById(R.id.close_about);
86 okButton.setOnClickListener(this); 85 okButton.setOnClickListener(new View.OnClickListener()
Felix Dahlke 2014/11/11 09:30:43 Not a particular fan of this pattern, gets messy p
87 } 86 {
88 87 @Override
89 @Override 88 public void onClick(View v)
90 public void onClick(View v) 89 {
91 { 90 AboutDialog.this.dismiss();
92 this.dismiss(); 91 }
92 });
93 } 93 }
94 } 94 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld