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

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

Issue 9433002: ABP/Android Proxy settings user helper (Closed)
Patch Set: Created Feb. 20, 2013, 8:49 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
OLDNEW
1 /* 1 /*
2 * This file is part of the Adblock Plus, 2 * This file is part of the Adblock Plus,
3 * Copyright (C) 2006-2012 Eyeo GmbH 3 * Copyright (C) 2006-2012 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
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 info.append("</h3>"); 69 info.append("</h3>");
70 info.append("<p>"); 70 info.append("<p>");
71 info.append(context.getString(R.string.version)); 71 info.append(context.getString(R.string.version));
72 info.append(": "); 72 info.append(": ");
73 info.append(versionName); 73 info.append(versionName);
74 info.append(" "); 74 info.append(" ");
75 info.append(context.getString(R.string.build)); 75 info.append(context.getString(R.string.build));
76 info.append(" "); 76 info.append(" ");
77 info.append(versionCode); 77 info.append(versionCode);
78 info.append("</p>"); 78 info.append("</p>");
79 appendRawTextFile(info, R.raw.info); 79 AdblockPlus.appendRawTextFile(context, info, R.raw.info);
80 appendRawTextFile(info, R.raw.legal); 80 AdblockPlus.appendRawTextFile(context, info, R.raw.legal);
81 81
82 // Show text 82 // Show text
83 TextView tv = (TextView) findViewById(R.id.about_text); 83 TextView tv = (TextView) findViewById(R.id.about_text);
84 tv.setText(Html.fromHtml(info.toString())); 84 tv.setText(Html.fromHtml(info.toString()));
85 tv.setMovementMethod(LinkMovementMethod.getInstance()); 85 tv.setMovementMethod(LinkMovementMethod.getInstance());
86 } 86 }
87
88 public static void appendRawTextFile(StringBuilder text, int id)
89 {
90 InputStream inputStream = context.getResources().openRawResource(id);
91 InputStreamReader in = new InputStreamReader(inputStream);
92 BufferedReader buf = new BufferedReader(in);
93 String line;
94 try
95 {
96 while ((line = buf.readLine()) != null)
97 text.append(line);
98 }
99 catch (IOException e)
100 {
101 e.printStackTrace();
102 }
103 }
104 } 87 }
OLDNEW

Powered by Google App Engine
This is Rietveld