AboutDialog.java
Go to the documentation of this file.
1 
5 package com.introlab.rtabmap;
6 
7 import java.io.BufferedReader;
8 import java.io.IOException;
9 import java.io.InputStream;
10 import java.io.InputStreamReader;
11 
12 import android.app.Dialog;
13 import android.content.Context;
14 import android.graphics.Color;
15 import android.os.Bundle;
16 import android.text.Html;
17 import android.text.method.LinkMovementMethod;
18 import android.text.util.Linkify;
19 import android.widget.TextView;
20 
21 public class AboutDialog extends Dialog{
22 
23  private static Context mContext = null;
24 
25  public AboutDialog(Context context) {
26  super(context);
27  mContext = context;
28  }
29 
33  @Override
34  public void onCreate(Bundle savedInstanceState) {
35  setContentView(R.layout.about);
36  TextView tv = (TextView)findViewById(R.id.info_text);
37  tv.setText(Html.fromHtml(readRawTextFile(R.raw.info)));
38  tv.setMovementMethod(LinkMovementMethod.getInstance());
39  tv.setLinkTextColor(Color.WHITE);
40  Linkify.addLinks(tv, Linkify.ALL);
41  tv.append(Html.fromHtml("<b><a href=http://introlab.github.io/rtabmap/index.html#privacy-policy>Privacy Policy</a></b>"));
42  }
43 
44  public static String readRawTextFile(int id) {
45  InputStream inputStream = mContext.getResources().openRawResource(id);
46  InputStreamReader in = new InputStreamReader(inputStream);
47  BufferedReader buf = new BufferedReader(in);
48  String line;
49  StringBuilder text = new StringBuilder();
50  try {
51  while (( line = buf.readLine()) != null) text.append(line);
52  } catch (IOException e) {
53  return null;
54  }
55  return text.toString();
56  }
57 
58 }
com.introlab.rtabmap.AboutDialog.readRawTextFile
static String readRawTextFile(int id)
Definition: AboutDialog.java:44
com.introlab.rtabmap.AboutDialog.onCreate
void onCreate(Bundle savedInstanceState)
Definition: AboutDialog.java:34
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
com.introlab.rtabmap.AboutDialog
Definition: AboutDialog.java:21
Color
Vector4f Color
com.introlab.rtabmap.AboutDialog.mContext
static Context mContext
Definition: AboutDialog.java:23
com.introlab.rtabmap.AboutDialog.AboutDialog
AboutDialog(Context context)
Definition: AboutDialog.java:25
text
text
R
R


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:06