Skip to content

Commit

Permalink
v3.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rignaneseleo committed Jun 11, 2016
1 parent 4d1f05e commit 572c1db
Show file tree
Hide file tree
Showing 16 changed files with 1,117 additions and 638 deletions.
14 changes: 14 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ App completely recoded:
- New interesting settings
- Credits updated
- Updated some translations
-Portuguese
-Hungarian
-Tamil

v3.5
- Messages Implemented with mbasic.facebook.com
Expand All @@ -189,4 +192,15 @@ v3.5
- Limited domains from the manifest
- Remove swipe to refresh bug (loaded always home)

v3.5.1
- Fixed settings scrolling on Android 4
- Fixed hidden search bar
- Fixed opening fb link when the app is closed
- Improved caching
- Added www.facebook.com to the allowed domains
- Added Swedish translation
- Added Czech translation
- Updated French translation
- Updated Traditional chinese translation

! Consider the possibility to donate !
4 changes: 1 addition & 3 deletions SlimFacebook/.idea/codeStyleSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

964 changes: 621 additions & 343 deletions SlimFacebook/.idea/workspace.xml

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions SlimFacebook/app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
Expand All @@ -80,6 +72,14 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
Expand Down
5 changes: 3 additions & 2 deletions SlimFacebook/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "it.rignanese.leo.slimfacebook"
minSdkVersion 15
targetSdkVersion 23
versionCode 34
versionName "3.5.0"
versionCode 35
versionName "3.5.1"
}
buildTypes {
release {
Expand All @@ -31,4 +31,5 @@ dependencies {
compile 'com.github.delight-im:Android-AdvancedWebView:da127f967f8dcf0ce5a0297c58e9bef2cc1a5ae8'
compile 'com.android.support:support-v4:23.4.0'
testCompile 'junit:junit:4.12'
// compile 'com.anjlab.android.iab.v3:library:1.0.+'
}
5 changes: 4 additions & 1 deletion SlimFacebook/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- gps -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- inApp donations -->
<uses-permission android:name="com.android.vending.BILLING"/>


<application
android:allowBackup="true"
Expand Down Expand Up @@ -54,7 +57,7 @@
android:host="mbasic.facebook.com"
android:scheme="https" />
<data
android:host="facebook.com"
android:host="www.facebook.com"
android:scheme="https" />
</intent-filter>
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ protected void onCreate(Bundle savedInstanceState) {

SetupWebView();//setup webview


SetupFullScreenVideo();

SetupOnLongClickListener();

if (isSharer) {//if is a share request
webViewFacebook.loadUrl(urlSharer);//load the sharer url

isSharer = false;
} else if (getIntent() != null && getIntent().getDataString() != null) {//if is a fb link open request
webViewFacebook.loadUrl(getIntent().getDataString());
} else GoHome();//load homepage
}

Expand Down Expand Up @@ -139,7 +139,7 @@ protected void onNewIntent(Intent intent) {
/** get a subject and text and check if this is a link trying to be shared */
String sharedSubject = getIntent().getStringExtra(Intent.EXTRA_SUBJECT);
String sharedUrl = getIntent().getStringExtra(Intent.EXTRA_TEXT);

Log.d("sharedUrl", "onNewIntent() - sharedUrl: " + sharedUrl);
// if we have a valid URL that was shared by us, open the sharer
if (sharedUrl != null) {
if (!sharedUrl.equals("")) {
Expand Down Expand Up @@ -169,6 +169,7 @@ protected void onNewIntent(Intent intent) {
}

//*********************** SETUP ****************************

private void SetupWebView() {
webViewFacebook = (AdvancedWebView) findViewById(R.id.webView);
WebSettings settings = webViewFacebook.getSettings();
Expand Down Expand Up @@ -206,6 +207,9 @@ private void SetupWebView() {
settings.setDisplayZoomControls(false);
settings.setBuiltInZoomControls(true);

// set caching
settings.setAppCachePath(getApplicationContext().getCacheDir().getAbsolutePath());
settings.setAppCacheEnabled(true);
//settings.setGeolocationDatabasePath(getBaseContext().getFilesDir().getPath()); it crashes on some devices

settings.setLoadsImagesAutomatically(!savedPreferences.getBoolean("pref_doNotDownloadImages", false));//to save data
Expand Down Expand Up @@ -346,6 +350,7 @@ private void ShareLinkHandler() {
/** get a subject and text and check if this is a link trying to be shared */
String sharedSubject = getIntent().getStringExtra(Intent.EXTRA_SUBJECT);
String sharedUrl = getIntent().getStringExtra(Intent.EXTRA_TEXT);
Log.d("sharedUrl", "ShareLinkHandler() - sharedUrl: " + sharedUrl);

// if we have a valid URL that was shared by us, open the sharer
if (sharedUrl != null) {
Expand Down Expand Up @@ -583,7 +588,7 @@ private static class MyHandler extends Handler {
private final WeakReference<MainActivity> mActivity;

public MyHandler(MainActivity activity) {
this.activity=activity;
this.activity = activity;
mActivity = new WeakReference<>(activity);
}

Expand All @@ -599,7 +604,7 @@ public void handleMessage(Message msg) {

if (url != null) {
/* "clean" an url to remove Facebook tracking redirection while sharing
and recreate all the special characters */
and recreate all the special characters */
url = decodeUrl(cleanUrl(url));

// create share intent for long clicked url
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package it.rignanese.leo.slimfacebook.settings;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
Expand All @@ -15,95 +16,99 @@
import it.rignanese.leo.slimfacebook.R;

/**
SlimSocial for Facebook is an Open Source app realized by Leonardo Rignanese <[email protected]>
* SlimSocial for Facebook is an Open Source app realized by Leonardo Rignanese <[email protected]>
* GNU GENERAL PUBLIC LICENSE Version 2, June 1991
* GITHUB: https://github.com/rignaneseleo/SlimSocial-for-Facebook
*/
public class SettingsActivity extends PreferenceActivity implements
SharedPreferences.OnSharedPreferenceChangeListener {

private static String appVersion;

//using a PreferenceFragment along with the PreferenceActivity (see there
// http://alvinalexander.com/android/android-tutorial-preferencescreen-preferenceactivity-preferencefragment )

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

//get the appVersion
try {
appVersion = appVersion();
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}

//load the fragment
getFragmentManager().beginTransaction().replace(android.R.id.content, new MyPreferenceFragment()).commit();
}

@Override
public void onResume() {
super.onResume();
// register the listener
PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).registerOnSharedPreferenceChangeListener(this);
}

@Override
public void onPause() {
super.onPause();
// unregister the listener
PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).unregisterOnSharedPreferenceChangeListener(this);
}

@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
switch (key) {
case "pref_recentNewsFirst":
case "pref_centerTextPosts":
case "pref_fixedBar":
case "pref_addSpaceBetweenPosts": {
Toast.makeText(SettingsActivity.this, R.string.refreshToApply, Toast.LENGTH_SHORT).show();
break;
}
case "pref_doNotDownloadImages":
case "pref_allowGeolocation":
case "pref_theme":
case "pref_textSize": {
restart();
break;
}
}
}
private void restart() {
// notify user
Toast.makeText(SettingsActivity.this, R.string.applyingChanges, Toast.LENGTH_SHORT).show();

// sending intent to onNewIntent() of MainActivity that restarts the app
Intent intent = new Intent(getApplicationContext(), MainActivity.class);
intent.putExtra("settingsChanged", true);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
}


//preference fragment
public static class MyPreferenceFragment extends PreferenceFragment {
@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.settings);//load the layout

//set the appVersion
Preference version = findPreference("pref_key_version");
version.setSummary(appVersion);// set the current version
}
}


//read the appVersion
private String appVersion() throws PackageManager.NameNotFoundException {
PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
return pInfo.versionName;
}
}
SharedPreferences.OnSharedPreferenceChangeListener {
private static String appVersion;

//using a PreferenceFragment along with the PreferenceActivity (see there
// http://alvinalexander.com/android/android-tutorial-preferencescreen-preferenceactivity-preferencefragment )

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

//get the appVersion
try {
appVersion = appVersion();
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}

//load the fragment
getFragmentManager().beginTransaction().replace(android.R.id.content, new MyPreferenceFragment()).commit();
}

//read the appVersion
private String appVersion() throws PackageManager.NameNotFoundException {
PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
return pInfo.versionName;
}

@Override
public void onResume() {
super.onResume();
// register the listener
PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).registerOnSharedPreferenceChangeListener(this);
}

@Override
public void onPause() {
super.onPause();
// unregister the listener
PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).unregisterOnSharedPreferenceChangeListener(this);
}

@Override
public void onDestroy() {
super.onDestroy();
}

@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
switch (key) {
case "pref_recentNewsFirst":
case "pref_centerTextPosts":
case "pref_fixedBar":
case "pref_addSpaceBetweenPosts": {
Toast.makeText(SettingsActivity.this, R.string.refreshToApply, Toast.LENGTH_SHORT).show();
break;
}
case "pref_doNotDownloadImages":
case "pref_allowGeolocation":
case "pref_theme":
case "pref_textSize": {
restart();
break;
}
}
}

private void restart() {
// notify user
Toast.makeText(SettingsActivity.this, R.string.applyingChanges, Toast.LENGTH_SHORT).show();

// sending intent to onNewIntent() of MainActivity that restarts the app
Intent intent = new Intent(getApplicationContext(), MainActivity.class);
intent.putExtra("settingsChanged", true);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
}

//preference fragment
public static class MyPreferenceFragment extends PreferenceFragment {
@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.settings);//load the layout

//set the appVersion
Preference version = findPreference("pref_key_version");
version.setSummary(appVersion);// set the current version
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package it.rignanese.leo.slimfacebook.utils;

import android.content.Context;
import android.preference.SwitchPreference;
import android.util.AttributeSet;

/**
* SlimSocial for Facebook is an Open Source app realized by Leonardo Rignanese <[email protected]>
* GNU GENERAL PUBLIC LICENSE Version 2, June 1991
* GITHUB: https://github.com/rignaneseleo/SlimSocial-for-Facebook
*/
public class SwitchWithoutBugs extends SwitchPreference {
public SwitchWithoutBugs(Context context) {
super(context);
}

public SwitchWithoutBugs(Context context, AttributeSet attrs) {
super(context, attrs);
}

public SwitchWithoutBugs(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
}
Loading

0 comments on commit 572c1db

Please sign in to comment.