Skip to content

Commit

Permalink
fixed tablet interface
Browse files Browse the repository at this point in the history
fixed donate button bug
  • Loading branch information
greyivy committed Dec 12, 2013
1 parent 269bd1f commit 0d2e7bd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 48 deletions.
4 changes: 2 additions & 2 deletions LinConnectClient/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.willhauck.linconnectclient"
android:versionCode="6"
android:versionName="2.12" >
android:versionCode="7"
android:versionName="2.13" >

<uses-sdk
android:minSdkVersion="14"
Expand Down
6 changes: 3 additions & 3 deletions LinConnectClient/res/xml/pref_general.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
</PreferenceCategory>
<PreferenceCategory android:title="Information" >
<Preference
android:key="pref_donate_btc"
android:summary="Tap here to donate via Bitcoin"
android:title="Donate via Bitcoin" />
android:key="pref_google_plus"
android:summary="Tap here to follow yycode on Google+"
android:title="Follow on Google+" />
<Preference
android:key="pref_donate_play"
android:summary="Tap here to donate by purchasing Donation Key"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,12 @@
import org.apache.http.util.EntityUtils;

import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.Preference;
Expand All @@ -56,8 +53,6 @@ public class ApplicationSettingsActivity extends PreferenceActivity {

ProgressDialog progressDialog;
PreferenceCategory applicationCategory;

private static final boolean ALWAYS_SIMPLE_PREFS = false;

@Override
protected void onPostCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -196,19 +191,4 @@ protected Boolean doInBackground(Object... notif) {
protected void onPostExecute(Boolean result) {
}
}

@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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 0d2e7bd

Please sign in to comment.