Android Open Source - nfcunlocker Settings Activity O A






From Project

Back to project page nfcunlocker.

License

The source code is released under:

Apache License

If you think the Android project nfcunlocker 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.steelrat.nfcunlocker.settingsactivity;
//from   w  ww.  ja va  2 s  . c  o  m
import android.os.Bundle;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.Preference.OnPreferenceClickListener;
import android.view.ViewGroup;

import com.steelrat.nfcunlocker.R;

@SuppressWarnings("deprecation")
public class SettingsActivityOA extends SettingsActivityBase {
  final static String ACTION_PREFS_GENERAL = "com.steelrat.nfcunlocker.PREFS_GENERAL";
  final static String ACTION_PREFS_ABOUT = "com.steelrat.nfcunlocker.PREFS_ABOUT";

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

    String action = getIntent().getAction();
    if (action != null && action.equals(ACTION_PREFS_GENERAL)) {
      loadGeneral();
    } else if (action != null && action.equals(ACTION_PREFS_ABOUT)) {
      loadAbout();
    } else {
      addPreferencesFromResource(R.xml.pref_headers_oa);
    }
  }

  private void loadGeneral() {
    addPreferencesFromResource(R.xml.pref_general);
    findPreference("unlock_method").setOnPreferenceChangeListener(
        new OnPreferenceChangeListener() {

          @Override
          public boolean onPreferenceChange(Preference preference,
              Object newValue) {
            return changeUnlockMethod((String) newValue);
          }
        }
    );

    findPreference("password").setOnPreferenceClickListener(
        new OnPreferenceClickListener() {

          @Override
          public boolean onPreferenceClick(Preference preference) {
            enableAdmin();
            
            return false;
          }
        }
    );
  }

  private void loadAbout() {
    setContentView(R.layout.settings_about);

    ViewGroup aboutView = (ViewGroup) ((ViewGroup) findViewById(android.R.id.content))
        .getChildAt(0);
    loadAbout(aboutView);
  }
}




Java Source Code List

com.steelrat.nfcunlocker.AddActivity.java
com.steelrat.nfcunlocker.DiscoveredActivity.java
com.steelrat.nfcunlocker.MainActivity.java
com.steelrat.nfcunlocker.NFCApplication.java
com.steelrat.nfcunlocker.helpers.AppDeviceAdminReceiver.java
com.steelrat.nfcunlocker.helpers.TagsStorage.java
com.steelrat.nfcunlocker.settingsactivity.SettingsActivityBase.java
com.steelrat.nfcunlocker.settingsactivity.SettingsActivityOA.java
com.steelrat.nfcunlocker.settingsactivity.SettingsActivity.java
com.steelrat.nfcunlocker.unlockmethods.DevicePolicyUnlockMethod.java
com.steelrat.nfcunlocker.unlockmethods.FlagUnlock.java
com.steelrat.nfcunlocker.unlockmethods.InputUnlock.java
com.steelrat.nfcunlocker.unlockmethods.KeyguardUnlock.java
com.steelrat.nfcunlocker.unlockmethods.UnlockMethodFactory.java
com.steelrat.nfcunlocker.unlockmethods.UnlockMethod.java