From 0d2e7bd73564b6c58c3dbb940bf43344470bba5e Mon Sep 17 00:00:00 2001 From: Will Hauck Date: Wed, 11 Dec 2013 23:09:24 -0700 Subject: [PATCH] fixed tablet interface fixed donate button bug --- LinConnectClient/AndroidManifest.xml | 4 +- LinConnectClient/res/xml/pref_general.xml | 6 +-- .../ApplicationSettingsActivity.java | 20 ---------- .../linconnectclient/SettingsActivity.java | 37 +++++++------------ 4 files changed, 19 insertions(+), 48 deletions(-) diff --git a/LinConnectClient/AndroidManifest.xml b/LinConnectClient/AndroidManifest.xml index 3ca5579..17b752a 100644 --- a/LinConnectClient/AndroidManifest.xml +++ b/LinConnectClient/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="7" + android:versionName="2.13" > + android:key="pref_google_plus" + android:summary="Tap here to follow yycode on Google+" + android:title="Follow on Google+" /> = Configuration.SCREENLAYOUT_SIZE_XLARGE; - } - - private static boolean isSimplePreferences(Context context) { - return ALWAYS_SIMPLE_PREFS - || Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB - || !isXLargeTablet(context); - } } diff --git a/LinConnectClient/src/com/willhauck/linconnectclient/SettingsActivity.java b/LinConnectClient/src/com/willhauck/linconnectclient/SettingsActivity.java index d13917e..04b0986 100644 --- a/LinConnectClient/src/com/willhauck/linconnectclient/SettingsActivity.java +++ b/LinConnectClient/src/com/willhauck/linconnectclient/SettingsActivity.java @@ -45,14 +45,12 @@ import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; -import android.content.res.Configuration; import android.graphics.drawable.Drawable; import android.net.Uri; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.net.wifi.WifiManager.MulticastLock; import android.os.AsyncTask; -import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.os.Message; @@ -68,8 +66,6 @@ @SuppressWarnings("deprecation") public class SettingsActivity extends PreferenceActivity { - private static final boolean ALWAYS_SIMPLE_PREFS = false; - private String jmDnsServiceType = "_linconnect._tcp.local."; private JmDNS mJmDNS; @@ -118,10 +114,6 @@ protected void onPostCreate(Bundle savedInstanceState) { @SuppressLint("SimpleDateFormat") private void setupSimplePreferencesScreen() { - if (!isSimplePreferences(this)) { - return; - } - // Load preferences sharedPreferences = PreferenceManager .getDefaultSharedPreferences(SettingsActivity.this); @@ -260,6 +252,20 @@ public void onClick( return true; } }); + + Preference prefGooglePlus = findPreference("pref_google_plus"); + prefGooglePlus + .setOnPreferenceClickListener(new OnPreferenceClickListener() { + @Override + public boolean onPreferenceClick(Preference arg0) { + // Open Google Plus page + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri + .parse("https://plus.google.com/114633032648182423928/posts")); + startActivity(intent); + return true; + } + }); Preference prefDonatePlay = findPreference("pref_donate_play"); prefDonatePlay @@ -459,21 +465,6 @@ public boolean onPreferenceClick(Preference arg0) { new ServerScanTask().execute(); } - @Override - public boolean onIsMultiPane() { - return isXLargeTablet(this) && !isSimplePreferences(this); - } - - private static boolean isXLargeTablet(Context context) { - return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE; - } - - private static boolean isSimplePreferences(Context context) { - return ALWAYS_SIMPLE_PREFS - || Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB - || !isXLargeTablet(context); - } - private static Preference.OnPreferenceChangeListener sBindPreferenceSummaryToValueListener = new Preference.OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object value) {