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 }
void onCreate(Bundle savedInstanceState)
GLM_FUNC_DECL genType e()
static String readRawTextFile(int id)


rtabmap
Author(s): Mathieu Labbe
autogenerated on Wed Jun 5 2019 22:41:30