Android Open Source - Battery-Indicator Help Activity






From Project

Back to project page Battery-Indicator.

License

The source code is released under:

GNU General Public License

If you think the Android project Battery-Indicator 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

/*
    Copyright (c) 2009-2013 Darshan-Josiah Barber
//from   ww w  .ja  va2 s.c om
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
*/

package com.darshancomputing.BatteryIndicatorPro;

import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.text.method.LinkMovementMethod;
import android.text.method.MovementMethod;
import android.text.util.Linkify;
import android.view.MenuItem;
import android.widget.TextView;

public class HelpActivity extends Activity {
    private static final int[] HAS_LINKS = {R.id.changelog, R.id.faq, R.id.website,
                                            R.id.open_source, R.id.acknowledgments,
                                            R.id.translations, R.id.contact};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // Stranglely disabled by default for API level 14+
        if (android.os.Build.VERSION.SDK_INT >= 14) {
            getActionBar().setHomeButtonEnabled(true);
            getActionBar().setDisplayHomeAsUpEnabled(true);
        }

        setContentView(R.layout.help);

        TextView tv;
        MovementMethod linkMovement = LinkMovementMethod.getInstance();

        for (int i=0; i < HAS_LINKS.length; i++) {
            tv = (TextView) findViewById(HAS_LINKS[i]);
            tv.setMovementMethod(linkMovement);
            tv.setAutoLinkMask(Linkify.WEB_URLS | Linkify.EMAIL_ADDRESSES);
        }

        tv = (TextView) findViewById(R.id.version);
        try {
            tv.setText(getResources().getString(R.string.app_full_name) + " " +
                       getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
        } catch (Exception e) {
            tv.setText("...");
        }
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
        case android.R.id.home:
            finish();
            return true;
        default:
            return super.onOptionsItemSelected(item);
        }
    }

    @Override
    protected void onResume() {
        super.onResume();
    }
}




Java Source Code List

com.darshancomputing.BatteryIndicatorPro.AlarmDatabase.java
com.darshancomputing.BatteryIndicatorPro.AlarmEditActivity.java
com.darshancomputing.BatteryIndicatorPro.AlarmRingtonePreference.java
com.darshancomputing.BatteryIndicatorPro.AlarmsActivity.java
com.darshancomputing.BatteryIndicatorPro.BatteryInfoActivity.java
com.darshancomputing.BatteryIndicatorPro.BatteryInfoAppWidgetProvider.java
com.darshancomputing.BatteryIndicatorPro.BatteryInfoService.java
com.darshancomputing.BatteryIndicatorPro.BatteryInfo.java
com.darshancomputing.BatteryIndicatorPro.BatteryLevel.java
com.darshancomputing.BatteryIndicatorPro.BootCompletedReceiver.java
com.darshancomputing.BatteryIndicatorPro.CircleWidgetBackground.java
com.darshancomputing.BatteryIndicatorPro.ColorPickerDialog.java
com.darshancomputing.BatteryIndicatorPro.ColorPickerPanelView.java
com.darshancomputing.BatteryIndicatorPro.ColorPickerPreference.java
com.darshancomputing.BatteryIndicatorPro.ColorPickerView.java
com.darshancomputing.BatteryIndicatorPro.ColorPreviewPreference.java
com.darshancomputing.BatteryIndicatorPro.CurrentInfoFragment.java
com.darshancomputing.BatteryIndicatorPro.FullAppWidgetProvider.java
com.darshancomputing.BatteryIndicatorPro.HelpActivity.java
com.darshancomputing.BatteryIndicatorPro.LogDatabase.java
com.darshancomputing.BatteryIndicatorPro.LogViewFragment.java
com.darshancomputing.BatteryIndicatorPro.Logger.java
com.darshancomputing.BatteryIndicatorPro.PluginServiceConnection.java
com.darshancomputing.BatteryIndicatorPro.PredictorCore.java
com.darshancomputing.BatteryIndicatorPro.Predictor.java
com.darshancomputing.BatteryIndicatorPro.SettingsActivity.java
com.darshancomputing.BatteryIndicatorPro.SettingsHelpActivity.java
com.darshancomputing.BatteryIndicatorPro.Str.java