Android Open Source - android-AppPuntalRadio About Dialog






From Project

Back to project page android-AppPuntalRadio.

License

The source code is released under:

GNU General Public License

If you think the Android project android-AppPuntalRadio listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.ivanob.puntalradio;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.text.Html;
import android.text.util.Linkify;
import android.graphics.Color;
import android.widget.TextView;
//  w  ww  . j ava 2s.  c  o m
public class AboutDialog extends Dialog{
private static Context mContext = null;
public AboutDialog(Context context) {
super(context);
mContext = context;
}

/**
}
* Standard Android on create method that gets called when the activity initialized.
*/

public void onCreate(Bundle savedInstanceState) {
  setContentView(R.layout.about);
  TextView tv = (TextView)findViewById(R.id.legal_text);
  tv.setText(readRawTextFile(R.raw.legal));
  tv = (TextView)findViewById(R.id.info_text);
  tv.setText(Html.fromHtml(readRawTextFile(R.raw.info)));
  //tv.setLinkTextColor(Color.WHITE);
  tv.setLinkTextColor(Color.BLUE);
  Linkify.addLinks(tv, Linkify.ALL);
}

public static String readRawTextFile(int id) {
  InputStream inputStream = mContext.getResources().openRawResource(id);
  InputStreamReader in = new InputStreamReader(inputStream);
  BufferedReader buf = new BufferedReader(in);
  String line;
  StringBuilder text = new StringBuilder();
  try {
    while (( line = buf.readLine()) != null) text.append(line);
    } catch (IOException e) {
    return null;
  }
  return text.toString();
}


}




Java Source Code List

com.ivanob.puntalradio.AboutDialog.java
com.ivanob.puntalradio.AppSectionsPagerAdapter.java
com.ivanob.puntalradio.Consts.java
com.ivanob.puntalradio.MainActivity.java
com.ivanob.puntalradio.ParrillaFragment.java
com.ivanob.puntalradio.PortadaFragment.java
com.ivanob.puntalradio.ProgramInfoDialog.java
com.ivanob.puntalradio.ProgramasFragment.java
com.ivanob.puntalradio.TimerSleepMode.java
com.ivanob.puntalradio.model.RadioManager.java
com.ivanob.puntalradio.model.RadioProgram.java
com.ivanob.puntalradio.model.RadioProgrammingManager.java
com.ivanob.puntalradio.model.StationConfigManager.java