1
0
Fork 0
mirror of https://github.com/gsantner/dandelion synced 2024-11-22 12:22:08 +01:00

Move Logging to own class; Allow disable normal&spam messages

This commit is contained in:
Gregor Santner 2016-09-19 01:10:29 +02:00
parent 67c416f870
commit ed55459019
40 changed files with 368 additions and 166 deletions

View file

@ -41,7 +41,7 @@
android:name=".activity.SettingsActivity" android:name=".activity.SettingsActivity"
android:launchMode="singleInstance" android:launchMode="singleInstance"
android:theme="@style/AppTheme" android:theme="@style/AppTheme"
android:label="@string/pref_title__personal_settings"> android:label="@string/settings">
</activity> </activity>
<service <service

View file

@ -29,11 +29,11 @@ import android.webkit.WebView;
import com.github.dfa.diaspora_android.data.AppSettings; import com.github.dfa.diaspora_android.data.AppSettings;
import com.github.dfa.diaspora_android.data.PodUserProfile; import com.github.dfa.diaspora_android.data.PodUserProfile;
import com.github.dfa.diaspora_android.util.AppLog;
import com.github.dfa.diaspora_android.util.AvatarImageLoader; import com.github.dfa.diaspora_android.util.AvatarImageLoader;
import com.github.dfa.diaspora_android.util.DiasporaUrlHelper; import com.github.dfa.diaspora_android.util.DiasporaUrlHelper;
public class App extends Application { public class App extends Application {
public static final String TAG = "DIASPORA_";
private AppSettings appSettings; private AppSettings appSettings;
private AvatarImageLoader avatarImageLoader; private AvatarImageLoader avatarImageLoader;
@ -45,6 +45,12 @@ public class App extends Application {
super.onCreate(); super.onCreate();
final Context c = getApplicationContext(); final Context c = getApplicationContext();
appSettings = new AppSettings(c); appSettings = new AppSettings(c);
// Init app log
AppLog.setLoggingEnabled(appSettings.isLoggingEnabled());
AppLog.setLoggingSpamEnabled(appSettings.isLoggingSpamEnabled());
// Init pod profile
avatarImageLoader = new AvatarImageLoader(c); avatarImageLoader = new AvatarImageLoader(c);
podUserProfile = new PodUserProfile(this); podUserProfile = new PodUserProfile(this);
@ -58,8 +64,8 @@ public class App extends Application {
cookieManager.setAcceptCookie(true); cookieManager.setAcceptCookie(true);
} }
public void resetPodData(@Nullable WebView webView){ public void resetPodData(@Nullable WebView webView) {
if(webView != null){ if (webView != null) {
webView.stopLoading(); webView.stopLoading();
webView.loadUrl(DiasporaUrlHelper.URL_BLANK); webView.loadUrl(DiasporaUrlHelper.URL_BLANK);
webView.clearFormData(); webView.clearFormData();
@ -81,7 +87,7 @@ public class App extends Application {
} }
} }
public PodUserProfile getPodUserProfile(){ public PodUserProfile getPodUserProfile() {
return podUserProfile; return podUserProfile;
} }

View file

@ -44,10 +44,10 @@ import com.github.dfa.diaspora_android.App;
import com.github.dfa.diaspora_android.R; import com.github.dfa.diaspora_android.R;
import com.github.dfa.diaspora_android.data.AppSettings; import com.github.dfa.diaspora_android.data.AppSettings;
import com.github.dfa.diaspora_android.ui.HtmlTextView; import com.github.dfa.diaspora_android.ui.HtmlTextView;
import com.github.dfa.diaspora_android.util.AppLog;
import com.github.dfa.diaspora_android.util.Helpers; import com.github.dfa.diaspora_android.util.Helpers;
import com.github.dfa.diaspora_android.util.Log; import com.github.dfa.diaspora_android.util.Log;
import java.util.ArrayList;
import java.util.Observable; import java.util.Observable;
import java.util.Observer; import java.util.Observer;
@ -94,7 +94,7 @@ public class AboutActivity extends AppCompatActivity {
tabLayout.setupWithViewPager(mViewPager); tabLayout.setupWithViewPager(mViewPager);
//Apply intellihide //Apply intellihide
if(!((App)getApplication()).getSettings().isIntellihideToolbars()) { if (!((App) getApplication()).getSettings().isIntellihideToolbars()) {
AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) linearLayout.getLayoutParams(); AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) linearLayout.getLayoutParams();
params.setScrollFlags(0); params.setScrollFlags(0);
} }
@ -194,6 +194,7 @@ public class AboutActivity extends AppCompatActivity {
*/ */
public static class DebugFragment extends Fragment implements Observer { public static class DebugFragment extends Fragment implements Observer {
private TextView logBox; private TextView logBox;
public DebugFragment() { public DebugFragment() {
} }
@ -210,14 +211,15 @@ public class AboutActivity extends AppCompatActivity {
logBox.setOnLongClickListener(new View.OnLongClickListener() { logBox.setOnLongClickListener(new View.OnLongClickListener() {
@Override @Override
public boolean onLongClick(View view) { public boolean onLongClick(View view) {
Log.d(App.TAG, "Long click registered"); AppLog.d(this, "Long click registered");
if(isAdded()) { if (isAdded()) {
ClipboardManager clipboard = (ClipboardManager) getActivity().getSystemService(CLIPBOARD_SERVICE); ClipboardManager clipboard = (ClipboardManager) getActivity().getSystemService(CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("DEBUG_LOG", Log.getLogBuffer()); ClipData clip = ClipData.newPlainText("DEBUG_LOG", Log.getLogBuffer());
clipboard.setPrimaryClip(clip); clipboard.setPrimaryClip(clip);
Toast.makeText(DebugFragment.this.getActivity(), R.string.fragment_debug__toast_log_copied, Toast.LENGTH_SHORT).show(); Toast.makeText(DebugFragment.this.getActivity(), R.string.fragment_debug__toast_log_copied, Toast.LENGTH_SHORT).show();
} else {
AppLog.d(this, "Not Added!");
} }
else Log.d(App.TAG, "Not Added!");
return true; return true;
} }
}); });
@ -233,7 +235,7 @@ public class AboutActivity extends AppCompatActivity {
appVersion.setText(getString(R.string.fragment_debug__app_version, pInfo.versionName + " (" + pInfo.versionCode + ")")); appVersion.setText(getString(R.string.fragment_debug__app_version, pInfo.versionName + " (" + pInfo.versionCode + ")"));
osVersion.setText(getString(R.string.fragment_debug__android_version, Build.VERSION.RELEASE)); osVersion.setText(getString(R.string.fragment_debug__android_version, Build.VERSION.RELEASE));
deviceName.setText(getString(R.string.fragment_debug__device_name, Build.MANUFACTURER+" "+Build.MODEL)); deviceName.setText(getString(R.string.fragment_debug__device_name, Build.MANUFACTURER + " " + Build.MODEL));
podDomain.setText(getString(R.string.fragment_debug__pod_domain, settings.getPodDomain())); podDomain.setText(getString(R.string.fragment_debug__pod_domain, settings.getPodDomain()));
} catch (PackageManager.NameNotFoundException e) { } catch (PackageManager.NameNotFoundException e) {
@ -252,7 +254,7 @@ public class AboutActivity extends AppCompatActivity {
@Override @Override
public void update(Observable observable, Object o) { public void update(Observable observable, Object o) {
if(logBox != null) { if (logBox != null) {
logBox.setText(Log.getLogBuffer()); logBox.setText(Log.getLogBuffer());
} }
} }

View file

@ -26,8 +26,6 @@ import android.app.AlarmManager;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.PendingIntent; import android.app.PendingIntent;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.graphics.drawable.LayerDrawable;
import android.support.v4.view.MenuItemCompat;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
@ -35,7 +33,7 @@ import android.content.IntentFilter;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.drawable.LayerDrawable;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
@ -44,7 +42,6 @@ import android.os.Handler;
import android.os.StrictMode; import android.os.StrictMode;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.customtabs.CustomTabsIntent;
import android.support.design.widget.AppBarLayout; import android.support.design.widget.AppBarLayout;
import android.support.design.widget.NavigationView; import android.support.design.widget.NavigationView;
import android.support.design.widget.Snackbar; import android.support.design.widget.Snackbar;
@ -86,11 +83,10 @@ import com.github.dfa.diaspora_android.receivers.UpdateTitleReceiver;
import com.github.dfa.diaspora_android.ui.BadgeDrawable; import com.github.dfa.diaspora_android.ui.BadgeDrawable;
import com.github.dfa.diaspora_android.ui.ContextMenuWebView; import com.github.dfa.diaspora_android.ui.ContextMenuWebView;
import com.github.dfa.diaspora_android.ui.CustomWebViewClient; import com.github.dfa.diaspora_android.ui.CustomWebViewClient;
import com.github.dfa.diaspora_android.util.CustomTabHelpers.BrowserFallback; import com.github.dfa.diaspora_android.util.AppLog;
import com.github.dfa.diaspora_android.util.CustomTabHelpers.CustomTabActivityHelper; import com.github.dfa.diaspora_android.util.CustomTabHelpers.CustomTabActivityHelper;
import com.github.dfa.diaspora_android.util.DiasporaUrlHelper; import com.github.dfa.diaspora_android.util.DiasporaUrlHelper;
import com.github.dfa.diaspora_android.util.Helpers; import com.github.dfa.diaspora_android.util.Helpers;
import com.github.dfa.diaspora_android.util.Log;
import com.github.dfa.diaspora_android.util.WebHelper; import com.github.dfa.diaspora_android.util.WebHelper;
import org.json.JSONException; import org.json.JSONException;
@ -188,14 +184,15 @@ public class MainActivity extends AppCompatActivity
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
Log.d(App.TAG, "onCreate()"); AppLog.v(this, "onCreate()");
// Bind UI // Bind UI
setContentView(R.layout.main__activity); setContentView(R.layout.main__activity);
if ((app = (App) getApplication()) == null) Log.e(App.TAG, "App is null!"); if ((app = (App) getApplication()) == null) AppLog.e(this, "App is null!");
if ((appSettings = app.getSettings()) == null) Log.e(App.TAG, "AppSettings is null!"); if ((appSettings = app.getSettings()) == null) AppLog.e(this, "AppSettings is null!");
if ((podUserProfile = app.getPodUserProfile()) == null) Log.e(App.TAG, "PodUserProfile is null!"); if ((podUserProfile = app.getPodUserProfile()) == null)
AppLog.e(this, "PodUserProfile is null!");
podUserProfile.setCallbackHandler(uiHandler); podUserProfile.setCallbackHandler(uiHandler);
podUserProfile.setListener(this); podUserProfile.setListener(this);
urls = new DiasporaUrlHelper(appSettings); urls = new DiasporaUrlHelper(appSettings);
@ -205,7 +202,7 @@ public class MainActivity extends AppCompatActivity
if (appSettings.isProxyEnabled()) { if (appSettings.isProxyEnabled()) {
if (!setProxy(appSettings.getProxyHost(), appSettings.getProxyPort())) { if (!setProxy(appSettings.getProxyHost(), appSettings.getProxyPort())) {
Log.d(App.TAG, "Could not enable Proxy"); AppLog.e(this, "Could not enable Proxy");
Toast.makeText(MainActivity.this, R.string.toast_set_proxy_failed, Toast.LENGTH_SHORT).show(); Toast.makeText(MainActivity.this, R.string.toast_set_proxy_failed, Toast.LENGTH_SHORT).show();
} }
} else if (appSettings.wasProxyEnabled()) { } else if (appSettings.wasProxyEnabled()) {
@ -227,27 +224,27 @@ public class MainActivity extends AppCompatActivity
} }
private void setupUI(Bundle savedInstanceState) { private void setupUI(Bundle savedInstanceState) {
Log.i(App.TAG, "MainActivity.setupUI()"); AppLog.i(this, "setupUI()");
ButterKnife.bind(this); ButterKnife.bind(this);
if (webviewPlaceholder.getChildCount() != 0) { if (webviewPlaceholder.getChildCount() != 0) {
Log.v(App.TAG, "remove child views from webViewPlaceholder"); AppLog.v(this, "remove child views from webViewPlaceholder");
webviewPlaceholder.removeAllViews(); webviewPlaceholder.removeAllViews();
} else { } else {
Log.v(App.TAG, "webViewPlaceholder had no child views"); AppLog.v(this, "webViewPlaceholder had no child views");
} }
boolean newWebView = (webView == null); boolean newWebView = (webView == null);
if(newWebView) { if (newWebView) {
Log.v(App.TAG, "WebView was null. Create new one."); AppLog.v(this, "WebView was null. Create new one.");
View webviewHolder = getLayoutInflater().inflate(R.layout.webview, this.contentLayout, false); View webviewHolder = getLayoutInflater().inflate(R.layout.webview, this.contentLayout, false);
this.webView = (ContextMenuWebView) webviewHolder.findViewById(R.id.webView); this.webView = (ContextMenuWebView) webviewHolder.findViewById(R.id.webView);
((LinearLayout)webView.getParent()).removeView(webView); ((LinearLayout) webView.getParent()).removeView(webView);
setupWebView(savedInstanceState); setupWebView(savedInstanceState);
} else { } else {
Log.v(App.TAG, "Reuse old WebView to avoid reloading page"); AppLog.v(this, "Reuse old WebView to avoid reloading page");
} }
Log.v(App.TAG, "Add WebView to placeholder"); AppLog.v(this, "Add WebView to placeholder");
webviewPlaceholder.addView(webView); webviewPlaceholder.addView(webView);
// Setup toolbar // Setup toolbar
setSupportActionBar(toolbarTop); setSupportActionBar(toolbarTop);
@ -291,7 +288,7 @@ public class MainActivity extends AppCompatActivity
String url = urls.getPodUrl(); String url = urls.getPodUrl();
if (newWebView) { if (newWebView) {
if (WebHelper.isOnline(MainActivity.this)) { if (WebHelper.isOnline(MainActivity.this)) {
Log.d(App.TAG, "setupUI: reload url"); AppLog.v(this, "setupUI: reload url");
webView.loadData("", "text/html", null); webView.loadData("", "text/html", null);
webView.loadUrlNew(url); webView.loadUrlNew(url);
} else { } else {
@ -300,23 +297,21 @@ public class MainActivity extends AppCompatActivity
} }
if (!appSettings.isIntellihideToolbars()) { if (!appSettings.isIntellihideToolbars()) {
Log.v(App.TAG, "Disable intelligent hiding of toolbars"); AppLog.v(this, "Disable intelligent hiding of toolbars");
AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) toolbarTop.getLayoutParams(); AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) toolbarTop.getLayoutParams();
params.setScrollFlags(0); // clear all scroll flags params.setScrollFlags(0); // clear all scroll flags
} }
Log.v(App.TAG, "UI successfully set up"); AppLog.v(this, "UI successfully set up");
handleIntent(getIntent()); handleIntent(getIntent());
} }
@Override @Override
public void onConfigurationChanged(Configuration newConfig) public void onConfigurationChanged(Configuration newConfig) {
{ AppLog.i(this, "onConfigurationChanged()");
Log.i(App.TAG, "onConfigurationChanged()"); if (webView != null) {
if (webView != null)
{
// Remove the WebView from the old placeholder // Remove the WebView from the old placeholder
Log.v(App.TAG, "removeView from placeholder in order to prevent recreation"); AppLog.v(this, "removeView from placeholder in order to prevent recreation");
webviewPlaceholder.removeView(webView); webviewPlaceholder.removeView(webView);
} }
@ -326,7 +321,7 @@ public class MainActivity extends AppCompatActivity
setContentView(R.layout.main__activity); setContentView(R.layout.main__activity);
// Reinitialize the UI // Reinitialize the UI
Log.v(App.TAG, "Rebuild the UI"); AppLog.v(this, "Rebuild the UI");
setupUI(null); setupUI(null);
} }
@ -343,7 +338,7 @@ public class MainActivity extends AppCompatActivity
webSettings.setAppCacheEnabled(true); webSettings.setAppCacheEnabled(true);
if (savedInstanceState != null) { if (savedInstanceState != null) {
Log.v(App.TAG, "restore WebView state"); AppLog.v(this, "restore WebView state");
webView.restoreState(savedInstanceState); webView.restoreState(savedInstanceState);
} }
@ -397,22 +392,21 @@ public class MainActivity extends AppCompatActivity
//For Android 4.1/4.2 only. DO NOT REMOVE! //For Android 4.1/4.2 only. DO NOT REMOVE!
@SuppressWarnings("unused") @SuppressWarnings("unused")
protected void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture) protected void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture) {
{ AppLog.v(this, "openFileChooser(ValCallback<Uri>, String, String");
Log.v(App.TAG, "openFileChooser(ValCallback<Uri>, String, String");
imageUploadFilePathCallbackOld = uploadMsg; imageUploadFilePathCallbackOld = uploadMsg;
Intent intent = new Intent(); Intent intent = new Intent();
intent.setType("image/*"); intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT); intent.setAction(Intent.ACTION_GET_CONTENT);
intent.putExtra("return-data", true); intent.putExtra("return-data", true);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
Log.v(App.TAG, "startActivityForResult"); AppLog.v(this, "startActivityForResult");
startActivityForResult(Intent.createChooser(intent, "Select Picture"), INPUT_FILE_REQUEST_CODE_OLD); startActivityForResult(Intent.createChooser(intent, "Select Picture"), INPUT_FILE_REQUEST_CODE_OLD);
} }
@Override @Override
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) { public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) {
if(Build.VERSION.SDK_INT >= 23) { if (Build.VERSION.SDK_INT >= 23) {
int hasWRITE_EXTERNAL_STORAGE = checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE); int hasWRITE_EXTERNAL_STORAGE = checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE);
if (hasWRITE_EXTERNAL_STORAGE != PackageManager.PERMISSION_GRANTED) { if (hasWRITE_EXTERNAL_STORAGE != PackageManager.PERMISSION_GRANTED) {
if (!shouldShowRequestPermissionRationale(Manifest.permission.WRITE_EXTERNAL_STORAGE)) { if (!shouldShowRequestPermissionRationale(Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
@ -436,8 +430,9 @@ public class MainActivity extends AppCompatActivity
} }
} }
Log.d(App.TAG, "onOpenFileChooser"); AppLog.v(this, "onOpenFileChooser");
if (imageUploadFilePathCallbackNew != null) imageUploadFilePathCallbackNew.onReceiveValue(null); if (imageUploadFilePathCallbackNew != null)
imageUploadFilePathCallbackNew.onReceiveValue(null);
imageUploadFilePathCallbackNew = filePathCallback; imageUploadFilePathCallbackNew = filePathCallback;
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
@ -448,7 +443,7 @@ public class MainActivity extends AppCompatActivity
photoFile = Helpers.createImageFile(); photoFile = Helpers.createImageFile();
takePictureIntent.putExtra("PhotoPath", mCameraPhotoPath); takePictureIntent.putExtra("PhotoPath", mCameraPhotoPath);
} catch (IOException ex) { } catch (IOException ex) {
Log.e(App.TAG, "ERROR creating temp file: "+ ex.toString()); AppLog.e(this, "ERROR creating temp file: " + ex.toString());
// Error occurred while creating the File // Error occurred while creating the File
Snackbar.make(contentLayout, R.string.unable_to_load_image, Snackbar.LENGTH_LONG).show(); Snackbar.make(contentLayout, R.string.unable_to_load_image, Snackbar.LENGTH_LONG).show();
return false; return false;
@ -480,7 +475,7 @@ public class MainActivity extends AppCompatActivity
chooserIntent.putExtra(Intent.EXTRA_TITLE, "Image Chooser"); chooserIntent.putExtra(Intent.EXTRA_TITLE, "Image Chooser");
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, intentArray); chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, intentArray);
Log.d(App.TAG,"startActivityForResult"); AppLog.v(this, "startActivityForResult");
startActivityForResult(chooserIntent, INPUT_FILE_REQUEST_CODE_NEW); startActivityForResult(chooserIntent, INPUT_FILE_REQUEST_CODE_NEW);
return true; return true;
} }
@ -523,14 +518,14 @@ public class MainActivity extends AppCompatActivity
if (!avatarUrl.equals("")) { if (!avatarUrl.equals("")) {
//Display app launcher icon instead of default avatar asset //Display app launcher icon instead of default avatar asset
//(Which would by the way not load because of missing pod domain prefix in the url) //(Which would by the way not load because of missing pod domain prefix in the url)
if(avatarUrl.startsWith("/assets/user/default")) { if (avatarUrl.startsWith("/assets/user/default")) {
Log.v(App.TAG, "Avatar appears to be an asset. Display launcher icon instead (avatarUrl="+avatarUrl+")"); AppLog.v(this, "Avatar appears to be an asset. Display launcher icon instead (avatarUrl=" + avatarUrl + ")");
navheaderImage.setImageResource(R.drawable.ic_launcher); navheaderImage.setImageResource(R.drawable.ic_launcher);
} else { } else {
// Try to load image // Try to load image
if (!app.getAvatarImageLoader().loadToImageView(navheaderImage)) { if (!app.getAvatarImageLoader().loadToImageView(navheaderImage)) {
// If not yet loaded, start download // If not yet loaded, start download
Log.v(App.TAG, "Avatar not cached. Start download: "+avatarUrl); AppLog.v(this, "Avatar not cached. Start download: " + avatarUrl);
app.getAvatarImageLoader().startImageDownload(navheaderImage, avatarUrl); app.getAvatarImageLoader().startImageDownload(navheaderImage, avatarUrl);
} }
} }
@ -552,7 +547,7 @@ public class MainActivity extends AppCompatActivity
@OnClick(R.id.toolbar) @OnClick(R.id.toolbar)
public void onToolBarClicked(View view) { public void onToolBarClicked(View view) {
Log.i(App.TAG, "MainActivity.onToolBarClicked()"); AppLog.i(this, "onToolBarClicked()");
onNavigationItemSelected(navView.getMenu().findItem(R.id.nav_stream)); onNavigationItemSelected(navView.getMenu().findItem(R.id.nav_stream));
} }
@ -564,35 +559,35 @@ public class MainActivity extends AppCompatActivity
} }
private void handleIntent(Intent intent) { private void handleIntent(Intent intent) {
Log.i(App.TAG, "MainActivity.handleIntent()"); AppLog.i(this, "handleIntent()");
if (intent == null) { if (intent == null) {
Log.v(App.TAG, "Intent was null"); AppLog.v(this, "Intent was null");
return; return;
} }
String action = intent.getAction(); String action = intent.getAction();
String type = intent.getType(); String type = intent.getType();
String loadUrl = null; String loadUrl = null;
Log.v(App.TAG, "Action: "+action+" Type: "+type); AppLog.v(this, "Action: " + action + " Type: " + type);
if (ACTION_OPEN_URL.equals(action)) { if (ACTION_OPEN_URL.equals(action)) {
loadUrl = intent.getStringExtra(URL_MESSAGE); loadUrl = intent.getStringExtra(URL_MESSAGE);
} else if (Intent.ACTION_VIEW.equals(action) && intent.getDataString() != null) { } else if (Intent.ACTION_VIEW.equals(action) && intent.getDataString() != null) {
Uri data = intent.getData(); Uri data = intent.getData();
if(data != null && data.toString().startsWith(CONTENT_HASHTAG)) { if (data != null && data.toString().startsWith(CONTENT_HASHTAG)) {
handleHashtag(intent); handleHashtag(intent);
return; return;
} else { } else {
loadUrl = intent.getDataString(); loadUrl = intent.getDataString();
} }
} else if (ACTION_CHANGE_ACCOUNT.equals(action)) { } else if (ACTION_CHANGE_ACCOUNT.equals(action)) {
Log.v(App.TAG, "Reset pod data and animate to PodSelectionActivity"); AppLog.v(this, "Reset pod data and animate to PodSelectionActivity");
app.resetPodData(webView); app.resetPodData(webView);
Helpers.animateToActivity(MainActivity.this, PodSelectionActivity.class, true); Helpers.animateToActivity(MainActivity.this, PodSelectionActivity.class, true);
} else if (ACTION_CLEAR_CACHE.equals(action)) { } else if (ACTION_CLEAR_CACHE.equals(action)) {
Log.v(App.TAG, "Clear WebView cache"); AppLog.v(this, "Clear WebView cache");
webView.clearCache(true); webView.clearCache(true);
} else if (ACTION_RELOAD_ACTIVITY.equals(action)) { } else if (ACTION_RELOAD_ACTIVITY.equals(action)) {
Log.v(App.TAG, "Recreate activity"); AppLog.v(this, "Recreate activity");
recreate(); recreate();
return; return;
} else if (Intent.ACTION_SEND.equals(action) && type != null) { } else if (Intent.ACTION_SEND.equals(action) && type != null) {
@ -621,61 +616,61 @@ public class MainActivity extends AppCompatActivity
@Override @Override
public void onActivityResult(int requestCode, int resultCode, Intent data) { public void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.d(App.TAG,"MainActivity.onActivityResult()"); AppLog.v(this, "onActivityResult()");
switch (requestCode) { switch (requestCode) {
case INPUT_FILE_REQUEST_CODE_NEW: { case INPUT_FILE_REQUEST_CODE_NEW: {
Log.v(App.TAG,"Upload image using recent method (Lollipop+)"); AppLog.v(this, "Upload image using recent method (Lollipop+)");
if (imageUploadFilePathCallbackNew == null || resultCode != Activity.RESULT_OK) { if (imageUploadFilePathCallbackNew == null || resultCode != Activity.RESULT_OK) {
Log.e(App.TAG, "Callback is null: " + (imageUploadFilePathCallbackNew == null) AppLog.e(this, "Callback is null: " + (imageUploadFilePathCallbackNew == null)
+ " resultCode: " + resultCode); + " resultCode: " + resultCode);
return; return;
} }
Uri[] results = null; Uri[] results = null;
if (data == null) { if (data == null) {
if (mCameraPhotoPath != null) { if (mCameraPhotoPath != null) {
Log.v(App.TAG, "Intent data is null. Try to parse cameraPhotoPath"); AppLog.v(this, "Intent data is null. Try to parse cameraPhotoPath");
results = new Uri[]{Uri.parse(mCameraPhotoPath)}; results = new Uri[]{Uri.parse(mCameraPhotoPath)};
} else { } else {
Log.w(App.TAG, "Intent data is null and cameraPhotoPath is null"); AppLog.w(this, "Intent data is null and cameraPhotoPath is null");
} }
} else { } else {
String dataString = data.getDataString(); String dataString = data.getDataString();
if (dataString != null) { if (dataString != null) {
Log.v(App.TAG, "Intent has data. Try to parse dataString"); AppLog.v(this, "Intent has data. Try to parse dataString");
results = new Uri[]{Uri.parse(dataString)}; results = new Uri[]{Uri.parse(dataString)};
} }
Log.w(App.TAG, "dataString is null"); AppLog.w(this, "dataString is null");
} }
Log.v(App.TAG, "handle received result over to callback"); AppLog.v(this, "handle received result over to callback");
imageUploadFilePathCallbackNew.onReceiveValue(results); imageUploadFilePathCallbackNew.onReceiveValue(results);
imageUploadFilePathCallbackNew = null; imageUploadFilePathCallbackNew = null;
return; return;
} }
case INPUT_FILE_REQUEST_CODE_OLD: { case INPUT_FILE_REQUEST_CODE_OLD: {
Log.v(App.TAG, "Upload image using legacy method (Jelly Bean, Kitkat)"); AppLog.v(this, "Upload image using legacy method (Jelly Bean, Kitkat)");
if (imageUploadFilePathCallbackOld == null || resultCode != Activity.RESULT_OK) { if (imageUploadFilePathCallbackOld == null || resultCode != Activity.RESULT_OK) {
Log.e(App.TAG, "Callback is null: " + (imageUploadFilePathCallbackOld == null) AppLog.e(this, "Callback is null: " + (imageUploadFilePathCallbackOld == null)
+ " resultCode: " + resultCode); + " resultCode: " + resultCode);
return; return;
} }
Uri results = null; Uri results = null;
if (data == null) { if (data == null) {
if (mCameraPhotoPath != null) { if (mCameraPhotoPath != null) {
Log.v(App.TAG, "Intent has no data. Try to parse cameraPhotoPath"); AppLog.v(this, "Intent has no data. Try to parse cameraPhotoPath");
results = Uri.parse(mCameraPhotoPath); results = Uri.parse(mCameraPhotoPath);
} else { } else {
Log.w(App.TAG, "Intent has no data and cameraPhotoPath is null"); AppLog.w(this, "Intent has no data and cameraPhotoPath is null");
} }
} else { } else {
String dataString = data.getDataString(); String dataString = data.getDataString();
if (dataString != null) { if (dataString != null) {
Log.v(App.TAG, "Intent has data. Try to parse dataString"); AppLog.v(this, "Intent has data. Try to parse dataString");
results = Uri.parse(dataString); results = Uri.parse(dataString);
} else { } else {
Log.w(App.TAG, "dataString is null"); AppLog.w(this, "dataString is null");
} }
} }
Log.v(App.TAG, "handle received result over to callback"); AppLog.v(this, "handle received result over to callback");
imageUploadFilePathCallbackOld.onReceiveValue(results); imageUploadFilePathCallbackOld.onReceiveValue(results);
imageUploadFilePathCallbackOld = null; imageUploadFilePathCallbackOld = null;
return; return;
@ -686,23 +681,23 @@ public class MainActivity extends AppCompatActivity
@Override @Override
protected void onSaveInstanceState(Bundle outState) { protected void onSaveInstanceState(Bundle outState) {
Log.v(App.TAG, "MainActivity.onSaveInstanceState()"); AppLog.v(this, "onSaveInstanceState()");
super.onSaveInstanceState(outState); super.onSaveInstanceState(outState);
Log.v(App.TAG, "Save WebView state"); AppLog.v(this, "Save WebView state");
webView.saveState(outState); webView.saveState(outState);
} }
@Override @Override
protected void onRestoreInstanceState(@NonNull Bundle savedInstanceState) { protected void onRestoreInstanceState(@NonNull Bundle savedInstanceState) {
Log.v(App.TAG, "MainActivity.onRestoreInstanceState()"); AppLog.v(this, "onRestoreInstanceState()");
super.onRestoreInstanceState(savedInstanceState); super.onRestoreInstanceState(savedInstanceState);
Log.v(App.TAG, "Restore state of WebView"); AppLog.v(this, "Restore state of WebView");
webView.restoreState(savedInstanceState); webView.restoreState(savedInstanceState);
} }
@Override @Override
public void onBackPressed() { public void onBackPressed() {
Log.v(App.TAG, "MainActivity.onBackPressed()"); AppLog.v(this, "onBackPressed()");
if (navDrawer.isDrawerOpen(navView)) { if (navDrawer.isDrawerOpen(navView)) {
navDrawer.closeDrawer(navView); navDrawer.closeDrawer(navView);
return; return;
@ -732,8 +727,8 @@ public class MainActivity extends AppCompatActivity
@Override @Override
protected void onPause() { protected void onPause() {
Log.v(App.TAG, "MainActivity.onPause()"); AppLog.v(this, "onPause()");
Log.v(App.TAG, "Unregister BroadcastReceivers"); AppLog.v(this, "Unregister BroadcastReceivers");
LocalBroadcastManager.getInstance(this).unregisterReceiver(brSetTitle); LocalBroadcastManager.getInstance(this).unregisterReceiver(brSetTitle);
LocalBroadcastManager.getInstance(this).unregisterReceiver(brOpenExternalLink); LocalBroadcastManager.getInstance(this).unregisterReceiver(brOpenExternalLink);
super.onPause(); super.onPause();
@ -741,16 +736,16 @@ public class MainActivity extends AppCompatActivity
@Override @Override
protected void onResume() { protected void onResume() {
Log.v(App.TAG, "MainActivity.onResume()"); AppLog.v(this, "onResume()");
super.onResume(); super.onResume();
Log.v(App.TAG, "Register BroadcastReceivers"); AppLog.v(this, "Register BroadcastReceivers");
LocalBroadcastManager.getInstance(this).registerReceiver(brSetTitle, new IntentFilter(ACTION_UPDATE_TITLE_FROM_URL)); LocalBroadcastManager.getInstance(this).registerReceiver(brSetTitle, new IntentFilter(ACTION_UPDATE_TITLE_FROM_URL));
LocalBroadcastManager.getInstance(this).registerReceiver(brOpenExternalLink, new IntentFilter(ACTION_OPEN_EXTERNAL_URL)); LocalBroadcastManager.getInstance(this).registerReceiver(brOpenExternalLink, new IntentFilter(ACTION_OPEN_EXTERNAL_URL));
} }
@Override @Override
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
Log.v(App.TAG, "MainActivity.onCreateOptionsMenu()"); AppLog.v(this, "onCreateOptionsMenu()");
getMenuInflater().inflate(R.menu.main__menu_top, menu); getMenuInflater().inflate(R.menu.main__menu_top, menu);
return true; return true;
} }
@ -773,7 +768,7 @@ public class MainActivity extends AppCompatActivity
@Override @Override
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
Log.i(App.TAG, "MainActivity.onOptionsItemSelected()"); AppLog.i(this, "onOptionsItemSelected()");
switch (item.getItemId()) { switch (item.getItemId()) {
case R.id.action_notifications: { case R.id.action_notifications: {
if (WebHelper.isOnline(MainActivity.this)) { if (WebHelper.isOnline(MainActivity.this)) {
@ -862,7 +857,7 @@ public class MainActivity extends AppCompatActivity
@Override @Override
public void onClick(DialogInterface dialogInterface, int which) { public void onClick(DialogInterface dialogInterface, int which) {
String query = input.getText().toString().trim().replaceAll((which == DialogInterface.BUTTON_NEGATIVE ? "\\*" : "\\#"), ""); String query = input.getText().toString().trim().replaceAll((which == DialogInterface.BUTTON_NEGATIVE ? "\\*" : "\\#"), "");
if(query.equals("")) { if (query.equals("")) {
Snackbar.make(contentLayout, R.string.search_alert_bypeople_validate_needsomedata, Snackbar.LENGTH_LONG).show(); Snackbar.make(contentLayout, R.string.search_alert_bypeople_validate_needsomedata, Snackbar.LENGTH_LONG).show();
} else { } else {
webView.loadUrl(which == DialogInterface.BUTTON_NEGATIVE ? urls.getSearchPeopleUrl(query) : urls.getSearchTagsUrl(query)); webView.loadUrl(which == DialogInterface.BUTTON_NEGATIVE ? urls.getSearchPeopleUrl(query) : urls.getSearchTagsUrl(query));
@ -908,7 +903,7 @@ public class MainActivity extends AppCompatActivity
@SuppressWarnings("ResultOfMethodCallIgnored") @SuppressWarnings("ResultOfMethodCallIgnored")
private boolean makeScreenshotOfWebView(boolean hasToShareScreenshot) { private boolean makeScreenshotOfWebView(boolean hasToShareScreenshot) {
Log.i(App.TAG, "MainActivity.makeScreenshotOfWebView()"); AppLog.i(this, "makeScreenshotOfWebView()");
if (android.os.Build.VERSION.SDK_INT >= 23) { if (android.os.Build.VERSION.SDK_INT >= 23) {
int hasWRITE_EXTERNAL_STORAGE = checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE); int hasWRITE_EXTERNAL_STORAGE = checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE);
if (hasWRITE_EXTERNAL_STORAGE != PackageManager.PERMISSION_GRANTED) { if (hasWRITE_EXTERNAL_STORAGE != PackageManager.PERMISSION_GRANTED) {
@ -939,8 +934,8 @@ public class MainActivity extends AppCompatActivity
String fileSaveName = hasToShareScreenshot ? ".DfA_share.jpg" : String.format("DfA_%s.jpg", dateFormat.format(dateNow)); String fileSaveName = hasToShareScreenshot ? ".DfA_share.jpg" : String.format("DfA_%s.jpg", dateFormat.format(dateNow));
if (!fileSaveDirectory.exists()) { if (!fileSaveDirectory.exists()) {
if(!fileSaveDirectory.mkdirs()) { if (!fileSaveDirectory.mkdirs()) {
Log.w(App.TAG, "Could not mkdir "+fileSaveDirectory.getAbsolutePath()); AppLog.w(this, "Could not mkdir " + fileSaveDirectory.getAbsolutePath());
} }
} }
@ -990,32 +985,32 @@ public class MainActivity extends AppCompatActivity
@Override @Override
public void onUserProfileNameChanged(String name) { public void onUserProfileNameChanged(String name) {
Log.i(App.TAG, "MainActivity.onUserProfileNameChanged()"); AppLog.i(this, "onUserProfileNameChanged()");
navheaderTitle.setText(name); navheaderTitle.setText(name);
} }
@Override @Override
public void onUserProfileAvatarChanged(String avatarUrl) { public void onUserProfileAvatarChanged(String avatarUrl) {
Log.i(App.TAG, "MainActivity.onUserProfileAvatarChanged()"); AppLog.i(this, "onUserProfileAvatarChanged()");
app.getAvatarImageLoader().startImageDownload(navheaderImage, avatarUrl); app.getAvatarImageLoader().startImageDownload(navheaderImage, avatarUrl);
} }
private void handleHashtag(Intent intent) { private void handleHashtag(Intent intent) {
Log.v(App.TAG, "handleHashtag()"); AppLog.v(this, "handleHashtag()");
try { try {
setSharedTexts(null, intent.getData().toString().split("/")[3]); setSharedTexts(null, intent.getData().toString().split("/")[3]);
} catch (Exception e) { } catch (Exception e) {
Log.e(App.TAG, e.toString()); AppLog.e(this, e.toString());
} }
webView.loadUrlNew(urls.getNewPostUrl()); webView.loadUrlNew(urls.getNewPostUrl());
} }
private void handleSendText(Intent intent) { private void handleSendText(Intent intent) {
Log.v(App.TAG, "handleSendText()"); AppLog.v(this, "handleSendText()");
try { try {
setSharedTexts(null, intent.getStringExtra(Intent.EXTRA_TEXT)); setSharedTexts(null, intent.getStringExtra(Intent.EXTRA_TEXT));
} catch (Exception e) { } catch (Exception e) {
Log.e(App.TAG, e.toString()); AppLog.e(this, e.toString());
} }
webView.loadUrlNew(urls.getBlankUrl()); webView.loadUrlNew(urls.getBlankUrl());
webView.loadUrlNew(urls.getNewPostUrl()); webView.loadUrlNew(urls.getNewPostUrl());
@ -1027,11 +1022,11 @@ public class MainActivity extends AppCompatActivity
* @param intent intent * @param intent intent
*/ */
private void handleSendSubject(Intent intent) { private void handleSendSubject(Intent intent) {
Log.v(App.TAG, "handleSendSubject()"); AppLog.v(this, "handleSendSubject()");
try { try {
setSharedTexts(intent.getStringExtra(Intent.EXTRA_SUBJECT), intent.getStringExtra(Intent.EXTRA_TEXT)); setSharedTexts(intent.getStringExtra(Intent.EXTRA_SUBJECT), intent.getStringExtra(Intent.EXTRA_TEXT));
} catch (Exception e) { } catch (Exception e) {
Log.e(App.TAG, e.toString()); AppLog.e(this, e.toString());
} }
webView.loadUrlNew(urls.getBlankUrl()); //TODO: Necessary? webView.loadUrlNew(urls.getBlankUrl()); //TODO: Necessary?
webView.loadUrlNew(urls.getNewPostUrl()); webView.loadUrlNew(urls.getNewPostUrl());
@ -1042,23 +1037,24 @@ public class MainActivity extends AppCompatActivity
* If subject is null, only the body will be set. Else the subject will be set as header. * If subject is null, only the body will be set. Else the subject will be set as header.
* Depending on whether the user has the setting isAppendSharedViaApp set, a reference to * Depending on whether the user has the setting isAppendSharedViaApp set, a reference to
* the app will be added at the bottom * the app will be added at the bottom
*
* @param sharedSubject post subject or null * @param sharedSubject post subject or null
* @param sharedBody post text * @param sharedBody post text
*/ */
private void setSharedTexts(String sharedSubject, String sharedBody) { private void setSharedTexts(String sharedSubject, String sharedBody) {
Log.i(App.TAG, "MainActivity.setSharedTexts()"); AppLog.i(this, "setSharedTexts()");
String body = WebHelper.replaceUrlWithMarkdown(sharedBody); String body = WebHelper.replaceUrlWithMarkdown(sharedBody);
if (appSettings.isAppendSharedViaApp()) { if (appSettings.isAppendSharedViaApp()) {
Log.v(App.TAG, "Append app reference to shared text"); AppLog.v(this, "Append app reference to shared text");
body = body + "\n\n" + getString(R.string.shared_by_diaspora_android); body = body + "\n\n" + getString(R.string.shared_by_diaspora_android);
} }
final String escapedBody = WebHelper.escapeHtmlText(body); final String escapedBody = WebHelper.escapeHtmlText(body);
if(sharedSubject != null) { if (sharedSubject != null) {
Log.v(App.TAG, "Append subject to shared text"); AppLog.v(this, "Append subject to shared text");
String escapedSubject = WebHelper.escapeHtmlText(WebHelper.replaceUrlWithMarkdown(sharedSubject)); String escapedSubject = WebHelper.escapeHtmlText(WebHelper.replaceUrlWithMarkdown(sharedSubject));
textToBeShared = "**" + escapedSubject + "** " + escapedBody; textToBeShared = "**" + escapedSubject + "** " + escapedBody;
} else { } else {
Log.v(App.TAG, "Set shared text; Subject: \""+sharedSubject+"\" Body: \""+sharedBody+"\""); AppLog.v(this, "Set shared text; Subject: \"" + sharedSubject + "\" Body: \"" + sharedBody + "\"");
textToBeShared = escapedBody; textToBeShared = escapedBody;
} }
@ -1067,13 +1063,13 @@ public class MainActivity extends AppCompatActivity
//TODO: Implement? //TODO: Implement?
private void handleSendImage(Intent intent) { private void handleSendImage(Intent intent) {
Log.i(App.TAG, "MainActivity.handleSendImage()"); AppLog.i(this, "handleSendImage()");
final Uri imageUri = intent.getParcelableExtra(Intent.EXTRA_STREAM); final Uri imageUri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
if (imageUri != null) { if (imageUri != null) {
Log.v(App.TAG, "imageUri is not null. Handle shared image"); AppLog.v(this, "imageUri is not null. Handle shared image");
// TODO: Update UI to reflect text being shared // TODO: Update UI to reflect text being shared
} else { } else {
Log.w(App.TAG, "imageUri is null. Cannot precede."); AppLog.w(this, "imageUri is null. Cannot precede.");
} }
Toast.makeText(this, "Not yet implemented.", Toast.LENGTH_SHORT).show(); Toast.makeText(this, "Not yet implemented.", Toast.LENGTH_SHORT).show();
} }
@ -1081,7 +1077,7 @@ public class MainActivity extends AppCompatActivity
// TODO: Move from Javascript interface // TODO: Move from Javascript interface
@Override @Override
public void onNotificationCountChanged(int notificationCount) { public void onNotificationCountChanged(int notificationCount) {
Log.i(App.TAG, "MainActivity.onNotificationCountChanged()"); AppLog.i(this, "onNotificationCountChanged()");
// Count saved in PodUserProfile // Count saved in PodUserProfile
invalidateOptionsMenu(); invalidateOptionsMenu();
@ -1094,7 +1090,7 @@ public class MainActivity extends AppCompatActivity
// TODO: Move from Javascript interface // TODO: Move from Javascript interface
@Override @Override
public void onUnreadMessageCountChanged(int unreadMessageCount) { public void onUnreadMessageCountChanged(int unreadMessageCount) {
Log.i(App.TAG, "MainActivity.onUnreadMessageCountChanged()"); AppLog.i(this, "onUnreadMessageCountChanged()");
// Count saved in PodUserProfile // Count saved in PodUserProfile
invalidateOptionsMenu(); invalidateOptionsMenu();
if (unreadMessageCount > 0 && !snackbarNewNotification.isShown() if (unreadMessageCount > 0 && !snackbarNewNotification.isShown()
@ -1106,12 +1102,12 @@ public class MainActivity extends AppCompatActivity
private class JavaScriptInterface { private class JavaScriptInterface {
@JavascriptInterface @JavascriptInterface
public void setUserProfile(final String webMessage) throws JSONException { public void setUserProfile(final String webMessage) throws JSONException {
Log.i(App.TAG, "MainActivity.JavaScriptInterface.setUserProfile()"); AppLog.spam(this, "JavaScriptInterface.setUserProfile()");
if (podUserProfile.isRefreshNeeded()) { if (podUserProfile.isRefreshNeeded()) {
Log.v(App.TAG, "PodUserProfile needs refresh; Try to parse JSON"); AppLog.spam(this, "PodUserProfile needs refresh; Try to parse JSON");
podUserProfile.parseJson(webMessage); podUserProfile.parseJson(webMessage);
} else { } else {
Log.v(App.TAG, "No PodUserProfile refresh needed"); AppLog.spam(this, "No PodUserProfile refresh needed");
} }
} }
@ -1124,7 +1120,7 @@ public class MainActivity extends AppCompatActivity
@SuppressWarnings("StatementWithEmptyBody") @SuppressWarnings("StatementWithEmptyBody")
@Override @Override
public boolean onNavigationItemSelected(MenuItem item) { public boolean onNavigationItemSelected(MenuItem item) {
Log.i(App.TAG, "MainActivity.onNavigationItemsSelected()"); AppLog.v(this, "onNavigationItemsSelected()");
// Handle navigation view item clicks here. // Handle navigation view item clicks here.
switch (item.getItemId()) { switch (item.getItemId()) {
case R.id.nav_stream: { case R.id.nav_stream: {
@ -1237,10 +1233,10 @@ public class MainActivity extends AppCompatActivity
switch (requestCode) { switch (requestCode) {
case REQUEST_CODE__ACCESS_EXTERNAL_STORAGE: case REQUEST_CODE__ACCESS_EXTERNAL_STORAGE:
if (grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { if (grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
Log.i(App.TAG, "MainActivity.onRequestPermissionsResult: Permission to access external storage granted"); AppLog.i(this, "onRequestPermissionsResult: Permission to access external storage granted");
Toast.makeText(this, R.string.permission_granted_try_again, Toast.LENGTH_SHORT).show(); Toast.makeText(this, R.string.permission_granted_try_again, Toast.LENGTH_SHORT).show();
} else { } else {
Log.w(App.TAG, "MainActivity.onRequestPermissionsResult: Permission to access external storage denied"); AppLog.w(this, "onRequestPermissionsResult: Permission to access external storage denied");
Toast.makeText(this, R.string.permission_denied, Toast.LENGTH_SHORT).show(); Toast.makeText(this, R.string.permission_denied, Toast.LENGTH_SHORT).show();
} }
return; return;
@ -1261,35 +1257,35 @@ public class MainActivity extends AppCompatActivity
* @throws IllegalArgumentException if arguments do not fit specifications above * @throws IllegalArgumentException if arguments do not fit specifications above
*/ */
private boolean setProxy(final String host, final int port) { private boolean setProxy(final String host, final int port) {
Log.i(App.TAG, "MainActivity.setProxy()"); AppLog.v(this, "setProxy()");
if (host != null && !host.equals("") && port >= 0) { if (host != null && !host.equals("") && port >= 0) {
Log.i(App.TAG, "Set proxy to "+host+":"+port); AppLog.v(this, "Set proxy to " + host + ":" + port);
//Temporary change thread policy //Temporary change thread policy
Log.v(App.TAG, "Set temporary ThreadPolicy"); AppLog.v(this, "Set temporary ThreadPolicy");
StrictMode.ThreadPolicy old = StrictMode.getThreadPolicy(); StrictMode.ThreadPolicy old = StrictMode.getThreadPolicy();
StrictMode.ThreadPolicy tmp = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.ThreadPolicy tmp = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(tmp); StrictMode.setThreadPolicy(tmp);
Log.v(App.TAG, "Apply NetCipher proxy settings"); AppLog.v(this, "Apply NetCipher proxy settings");
NetCipher.setProxy(host, port); //Proxy for HttpsUrlConnections NetCipher.setProxy(host, port); //Proxy for HttpsUrlConnections
try { try {
//Proxy for the webview //Proxy for the webview
Log.v(App.TAG, "Apply Webkit proxy settings"); AppLog.v(this, "Apply Webkit proxy settings");
WebkitProxy.setProxy(MainActivity.class.getName(), getApplicationContext(), null, host, port); WebkitProxy.setProxy(MainActivity.class.getName(), getApplicationContext(), null, host, port);
} catch (Exception e) { } catch (Exception e) {
Log.e(App.TAG, "Could not apply WebKit proxy settings:\n"+e.toString()); AppLog.e(this, "Could not apply WebKit proxy settings:\n" + e.toString());
} }
Log.v(App.TAG, "Save changes in appSettings"); AppLog.v(this, "Save changes in appSettings");
appSettings.setProxyEnabled(true); appSettings.setProxyEnabled(true);
appSettings.setProxyWasEnabled(true); appSettings.setProxyWasEnabled(true);
Log.v(App.TAG, "Reset old ThreadPolicy"); AppLog.v(this, "Reset old ThreadPolicy");
StrictMode.setThreadPolicy(old); StrictMode.setThreadPolicy(old);
Log.i(App.TAG, "Success! Reload WebView"); AppLog.v(this, "Success! Reload WebView");
webView.reload(); webView.reload();
return true; return true;
} else { } else {
Log.w(App.TAG, "Invalid proxy configuration. Host: "+host+" Port: "+port+"\nRefuse to set proxy"); AppLog.w(this, "Invalid proxy configuration. Host: " + host + " Port: " + port + "\nRefuse to set proxy");
return false; return false;
} }
} }
@ -1299,30 +1295,30 @@ public class MainActivity extends AppCompatActivity
} }
private void resetProxy() { private void resetProxy() {
Log.i(App.TAG, "MainActivity.resetProxy()"); AppLog.i(this, "resetProxy()");
Log.v(App.TAG, "write changes to appSettings"); AppLog.v(this, "write changes to appSettings");
appSettings.setProxyEnabled(false); appSettings.setProxyEnabled(false);
appSettings.setProxyWasEnabled(false); appSettings.setProxyWasEnabled(false);
//Temporary change thread policy //Temporary change thread policy
Log.v(App.TAG, "Set temporary ThreadPolicy"); AppLog.v(this, "Set temporary ThreadPolicy");
StrictMode.ThreadPolicy old = StrictMode.getThreadPolicy(); StrictMode.ThreadPolicy old = StrictMode.getThreadPolicy();
StrictMode.ThreadPolicy tmp = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.ThreadPolicy tmp = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(tmp); StrictMode.setThreadPolicy(tmp);
Log.v(App.TAG, "clear NetCipher proxy"); AppLog.v(this, "clear NetCipher proxy");
NetCipher.clearProxy(); NetCipher.clearProxy();
try { try {
Log.v(App.TAG, "clear WebKit proxy"); AppLog.v(this, "clear WebKit proxy");
WebkitProxy.resetProxy(MainActivity.class.getName(), this); WebkitProxy.resetProxy(MainActivity.class.getName(), this);
} catch (Exception e) { } catch (Exception e) {
Log.e(App.TAG, "Could not clear WebKit proxy:\n"+e.toString()); AppLog.e(this, "Could not clear WebKit proxy:\n" + e.toString());
} }
Log.v(App.TAG, "Reset old ThreadPolicy"); AppLog.v(this, "Reset old ThreadPolicy");
StrictMode.setThreadPolicy(old); StrictMode.setThreadPolicy(old);
//Restart app //Restart app
Log.i(App.TAG, "Success! Restart app due to proxy reset"); AppLog.i(this, "Success! Restart app due to proxy reset");
Intent restartActivity = new Intent(this, MainActivity.class); Intent restartActivity = new Intent(this, MainActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 12374, restartActivity, PendingIntent.FLAG_CANCEL_CURRENT); PendingIntent pendingIntent = PendingIntent.getActivity(this, 12374, restartActivity, PendingIntent.FLAG_CANCEL_CURRENT);
AlarmManager mgr = (AlarmManager) getSystemService(Context.ALARM_SERVICE); AlarmManager mgr = (AlarmManager) getSystemService(Context.ALARM_SERVICE);

View file

@ -34,6 +34,8 @@ import android.view.MenuItem;
import com.github.dfa.diaspora_android.App; import com.github.dfa.diaspora_android.App;
import com.github.dfa.diaspora_android.R; import com.github.dfa.diaspora_android.R;
import com.github.dfa.diaspora_android.data.AppSettings;
import com.github.dfa.diaspora_android.util.AppLog;
/** /**
* @author vanitas * @author vanitas
@ -45,14 +47,13 @@ public class SettingsActivity extends AppCompatActivity {
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
ActionBar toolbar = getSupportActionBar(); ActionBar toolbar = getSupportActionBar();
if(toolbar != null) if (toolbar != null)
toolbar.setDisplayHomeAsUpEnabled(true); toolbar.setDisplayHomeAsUpEnabled(true);
getFragmentManager().beginTransaction().replace(android.R.id.content, new SettingsFragment()).commit(); getFragmentManager().beginTransaction().replace(android.R.id.content, new SettingsFragment()).commit();
} }
@Override @Override
public boolean onOptionsItemSelected(MenuItem menuItem) public boolean onOptionsItemSelected(MenuItem menuItem) {
{
switch (menuItem.getItemId()) { switch (menuItem.getItemId()) {
case android.R.id.home: case android.R.id.home:
onBackPressed(); onBackPressed();
@ -93,7 +94,7 @@ public class SettingsActivity extends AppCompatActivity {
@Override @Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
updatePreference(findPreference(key)); updatePreference(findPreference(key));
if(key != null && isAdded() && (key.equals(getString(R.string.pref_key__clear_cache)) || if (key != null && isAdded() && (key.equals(getString(R.string.pref_key__clear_cache)) ||
key.equals(getString(R.string.pref_key__font_size)) || key.equals(getString(R.string.pref_key__font_size)) ||
key.equals(getString(R.string.pref_key__load_images)) || key.equals(getString(R.string.pref_key__load_images)) ||
key.equals(getString(R.string.pref_key__intellihide_toolbars)) || key.equals(getString(R.string.pref_key__intellihide_toolbars)) ||
@ -157,6 +158,7 @@ public class SettingsActivity extends AppCompatActivity {
.show(); .show();
return true; return true;
} }
default: { default: {
intent = null; intent = null;
break; break;
@ -171,6 +173,16 @@ public class SettingsActivity extends AppCompatActivity {
} }
} }
@Override
protected void onPause() {
super.onPause();
// Reset logging
AppSettings settings = new AppSettings(getApplicationContext());
AppLog.setLoggingEnabled(settings.isLoggingEnabled());
AppLog.setLoggingSpamEnabled(settings.isLoggingSpamEnabled());
}
@Override @Override
protected void onStop() { protected void onStop() {
super.onStop(); super.onStop();

View file

@ -260,6 +260,14 @@ public class AppSettings {
return getBoolean(prefApp, R.string.pref_key__chrome_custom_tabs_enabled, true); return getBoolean(prefApp, R.string.pref_key__chrome_custom_tabs_enabled, true);
} }
public boolean isLoggingEnabled() {
return getBoolean(prefApp, R.string.pref_key__logging_enabled, true);
}
public boolean isLoggingSpamEnabled() {
return getBoolean(prefApp, R.string.pref_key__logging_spam_enabled, false);
}
public boolean isVisibleInNavExit() { public boolean isVisibleInNavExit() {
return getBoolean(prefApp, R.string.pref_key__visibility_nav__exit, false); return getBoolean(prefApp, R.string.pref_key__visibility_nav__exit, false);
} }

View file

@ -19,6 +19,8 @@
package com.github.dfa.diaspora_android.data; package com.github.dfa.diaspora_android.data;
import android.os.Handler; import android.os.Handler;
import com.github.dfa.diaspora_android.util.AppLog;
import com.github.dfa.diaspora_android.util.Log; import com.github.dfa.diaspora_android.util.Log;
import com.github.dfa.diaspora_android.App; import com.github.dfa.diaspora_android.App;
@ -126,7 +128,7 @@ public class PodUserProfile {
isWebUserProfileLoaded = true; isWebUserProfileLoaded = true;
} catch (JSONException e) { } catch (JSONException e) {
Log.d(App.TAG, e.getMessage()); AppLog.d(this, e.getMessage());
isWebUserProfileLoaded = false; isWebUserProfileLoaded = false;
} }
lastLoaded = System.currentTimeMillis(); lastLoaded = System.currentTimeMillis();

View file

@ -13,6 +13,7 @@ import com.github.dfa.diaspora_android.App;
import com.github.dfa.diaspora_android.R; import com.github.dfa.diaspora_android.R;
import com.github.dfa.diaspora_android.activity.MainActivity; import com.github.dfa.diaspora_android.activity.MainActivity;
import com.github.dfa.diaspora_android.data.AppSettings; import com.github.dfa.diaspora_android.data.AppSettings;
import com.github.dfa.diaspora_android.util.AppLog;
import com.github.dfa.diaspora_android.util.CustomTabHelpers.BrowserFallback; import com.github.dfa.diaspora_android.util.CustomTabHelpers.BrowserFallback;
import com.github.dfa.diaspora_android.util.CustomTabHelpers.CustomTabActivityHelper; import com.github.dfa.diaspora_android.util.CustomTabHelpers.CustomTabActivityHelper;
import com.github.dfa.diaspora_android.util.Helpers; import com.github.dfa.diaspora_android.util.Helpers;
@ -33,14 +34,14 @@ public class OpenExternalLinkReceiver extends BroadcastReceiver {
public void onReceive(Context c, Intent receiveIntent) { public void onReceive(Context c, Intent receiveIntent) {
AppSettings settings = new AppSettings(c); AppSettings settings = new AppSettings(c);
Log.v(App.TAG, "OpenExternalLinkReceiver.onReceive(): url"); AppLog.v(this, "OpenExternalLinkReceiver.onReceive(): url");
Uri url = null; Uri url = null;
try { try {
String sUrl = receiveIntent.getStringExtra(MainActivity.EXTRA_URL); String sUrl = receiveIntent.getStringExtra(MainActivity.EXTRA_URL);
url = Uri.parse(sUrl); url = Uri.parse(sUrl);
} catch (Exception _ignored) { } catch (Exception _ignored) {
Log.v(App.TAG, "Could not open Chrome Custom Tab (bad URL)"); AppLog.v(this, "Could not open Chrome Custom Tab (bad URL)");
return; return;
} }

View file

@ -8,8 +8,8 @@ import com.github.dfa.diaspora_android.App;
import com.github.dfa.diaspora_android.R; import com.github.dfa.diaspora_android.R;
import com.github.dfa.diaspora_android.activity.MainActivity; import com.github.dfa.diaspora_android.activity.MainActivity;
import com.github.dfa.diaspora_android.data.AppSettings; import com.github.dfa.diaspora_android.data.AppSettings;
import com.github.dfa.diaspora_android.util.AppLog;
import com.github.dfa.diaspora_android.util.DiasporaUrlHelper; import com.github.dfa.diaspora_android.util.DiasporaUrlHelper;
import com.github.dfa.diaspora_android.util.Log;
/** /**
* BroadcastReceiver used to update the title of the MainActivity depending on the url of the webview * BroadcastReceiver used to update the title of the MainActivity depending on the url of the webview
@ -17,7 +17,7 @@ import com.github.dfa.diaspora_android.util.Log;
*/ */
public class UpdateTitleReceiver extends BroadcastReceiver { public class UpdateTitleReceiver extends BroadcastReceiver {
private DiasporaUrlHelper urls; private DiasporaUrlHelper urls;
private AppSettings appSettings; private AppSettings appSettings;
private App app; private App app;
private TitleCallback callback; private TitleCallback callback;
@ -33,7 +33,7 @@ public class UpdateTitleReceiver extends BroadcastReceiver {
String url = intent.getStringExtra(MainActivity.EXTRA_URL); String url = intent.getStringExtra(MainActivity.EXTRA_URL);
if (url != null && url.startsWith(urls.getPodUrl())) { if (url != null && url.startsWith(urls.getPodUrl())) {
String subUrl = url.substring((urls.getPodUrl()).length()); String subUrl = url.substring((urls.getPodUrl()).length());
Log.v(App.TAG, "UpdateTitleReceiver.onReceive(): Set title for subUrl "+subUrl); AppLog.spam(this, "onReceive()- Set title for subUrl " + subUrl);
if (subUrl.startsWith(DiasporaUrlHelper.SUBURL_STREAM)) { if (subUrl.startsWith(DiasporaUrlHelper.SUBURL_STREAM)) {
setTitle(R.string.nav_stream); setTitle(R.string.nav_stream);
} else if (subUrl.startsWith(DiasporaUrlHelper.SUBURL_POSTS)) { } else if (subUrl.startsWith(DiasporaUrlHelper.SUBURL_POSTS)) {
@ -56,11 +56,11 @@ public class UpdateTitleReceiver extends BroadcastReceiver {
setTitle(R.string.nav_mentions); setTitle(R.string.nav_mentions);
} else if (subUrl.startsWith(DiasporaUrlHelper.SUBURL_PUBLIC)) { } else if (subUrl.startsWith(DiasporaUrlHelper.SUBURL_PUBLIC)) {
setTitle(R.string.public_); setTitle(R.string.public_);
} else if (urls.isAspectUrl(url)){ } else if (urls.isAspectUrl(url)) {
setTitle(urls.getAspectNameFromUrl(url, app)); setTitle(urls.getAspectNameFromUrl(url, app));
} }
} else { } else {
Log.w(App.TAG, "UpdateTitleReceiver.onReceive(): Invalid url: "+url); AppLog.spam(this, "onReceive()- Invalid url: " + url);
} }
} }
@ -74,6 +74,7 @@ public class UpdateTitleReceiver extends BroadcastReceiver {
public interface TitleCallback { public interface TitleCallback {
void setTitle(int Rid); void setTitle(int Rid);
void setTitle(String title); void setTitle(String title);
} }
} }

View file

@ -23,9 +23,8 @@ import android.content.Intent;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.IBinder; import android.os.IBinder;
import android.support.v4.content.LocalBroadcastManager; import android.support.v4.content.LocalBroadcastManager;
import com.github.dfa.diaspora_android.util.Log;
import com.github.dfa.diaspora_android.App; import com.github.dfa.diaspora_android.util.AppLog;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONObject; import org.json.JSONObject;
@ -43,7 +42,6 @@ import info.guardianproject.netcipher.NetCipher;
public class GetPodsService extends Service { public class GetPodsService extends Service {
public static final String MESSAGE_PODS_RECEIVED = "com.github.dfa.diaspora.podsreceived"; public static final String MESSAGE_PODS_RECEIVED = "com.github.dfa.diaspora.podsreceived";
private static final String TAG = App.TAG;
public GetPodsService() { public GetPodsService() {
} }
@ -92,7 +90,7 @@ public class GetPodsService extends Service {
connection.disconnect(); connection.disconnect();
} else { } else {
Log.e(TAG, "Failed to download list of pods"); AppLog.e(this, "Failed to download list of pods");
} }
} catch (IOException e) { } catch (IOException e) {
//TODO handle json buggy feed //TODO handle json buggy feed
@ -102,7 +100,7 @@ public class GetPodsService extends Service {
try { try {
JSONObject jsonObjectAll = new JSONObject(builder.toString()); JSONObject jsonObjectAll = new JSONObject(builder.toString());
JSONArray jsonArrayAll = jsonObjectAll.getJSONArray("pods"); JSONArray jsonArrayAll = jsonObjectAll.getJSONArray("pods");
Log.d(TAG, "Number of entries " + jsonArrayAll.length()); AppLog.d(this, "Number of entries " + jsonArrayAll.length());
list = new ArrayList<>(); list = new ArrayList<>();
for (int i = 0; i < jsonArrayAll.length(); i++) { for (int i = 0; i < jsonArrayAll.length(); i++) {
JSONObject jo = jsonArrayAll.getJSONObject(i); JSONObject jo = jsonArrayAll.getJSONObject(i);

View file

@ -22,6 +22,8 @@ import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import com.github.dfa.diaspora_android.util.AppLog;
import com.github.dfa.diaspora_android.util.Log; import com.github.dfa.diaspora_android.util.Log;
import android.widget.ImageView; import android.widget.ImageView;
@ -78,7 +80,7 @@ public class ImageDownloadTask extends AsyncTask<String, Void, Bitmap> {
connection.disconnect(); connection.disconnect();
} catch (Exception e) { } catch (Exception e) {
Log.e(App.TAG, e.getMessage()); AppLog.e(this, e.getMessage());
} finally { } finally {
try { try {
if (out != null) { if (out != null) {

View file

@ -20,6 +20,8 @@ package com.github.dfa.diaspora_android.task;
import android.content.Context; import android.content.Context;
import android.os.AsyncTask; import android.os.AsyncTask;
import com.github.dfa.diaspora_android.util.AppLog;
import com.github.dfa.diaspora_android.util.Log; import com.github.dfa.diaspora_android.util.Log;
import android.webkit.CookieManager; import android.webkit.CookieManager;
@ -60,7 +62,7 @@ public class ProfileFetchTask extends AsyncTask<Void, Void, Void> {
String extractedProfileData = null; String extractedProfileData = null;
final CookieManager cookieManager = app.getCookieManager(); final CookieManager cookieManager = app.getCookieManager();
String cookies = cookieManager.getCookie(urls.getPodUrl()); String cookies = cookieManager.getCookie(urls.getPodUrl());
Log.d(App.TAG, cookies); AppLog.d(this, cookies);
HttpsURLConnection connection; HttpsURLConnection connection;
InputStream inStream; InputStream inStream;
@ -101,7 +103,7 @@ public class ProfileFetchTask extends AsyncTask<Void, Void, Void> {
if (extractedProfileData != null) { if (extractedProfileData != null) {
PodUserProfile profile = new PodUserProfile(app); PodUserProfile profile = new PodUserProfile(app);
profile.parseJson(extractedProfileData); profile.parseJson(extractedProfileData);
Log.d(App.TAG, "Extracted new_messages (service):" + profile.getUnreadMessagesCount()); AppLog.d(this, "Extracted new_messages (service):" + profile.getUnreadMessagesCount());
} }
return null; return null;

View file

@ -20,6 +20,8 @@ package com.github.dfa.diaspora_android.task;
import android.content.Context; import android.content.Context;
import android.os.AsyncTask; import android.os.AsyncTask;
import com.github.dfa.diaspora_android.util.AppLog;
import com.github.dfa.diaspora_android.util.Log; import com.github.dfa.diaspora_android.util.Log;
import android.webkit.CookieManager; import android.webkit.CookieManager;
@ -77,7 +79,7 @@ public class StatisticsFetchTask extends AsyncTask<Void, Void, Void> {
BufferedReader br = new BufferedReader(new InputStreamReader(inStream)); BufferedReader br = new BufferedReader(new InputStreamReader(inStream));
String line; String line;
while ((line = br.readLine()) != null) { while ((line = br.readLine()) != null) {
Log.d(App.TAG, "STATS: "+line); AppLog.d(this, "STATS: "+line);
} }
try{ try{

View file

@ -52,13 +52,13 @@ public class CustomWebViewClient extends WebViewClient {
final CookieManager cookieManager = app.getCookieManager(); final CookieManager cookieManager = app.getCookieManager();
String cookies = cookieManager.getCookie(url); String cookies = cookieManager.getCookie(url);
//Log.d(App.TAG, "All the cookies in a string:" + cookies); //Log.d(this, "All the cookies in a string:" + cookies);
if (cookies != null) { if (cookies != null) {
cookieManager.setCookie(url, cookies); cookieManager.setCookie(url, cookies);
cookieManager.setCookie("https://" + app.getSettings().getPodDomain(), cookies); cookieManager.setCookie("https://" + app.getSettings().getPodDomain(), cookies);
//for (String c : cookies.split(";")) { //for (String c : cookies.split(";")) {
// Log.d(App.TAG, "Cookie: " + c.split("=")[0] + " Value:" + c.split("=")[1]); //AppLog.d(this, "Cookie: " + c.split("=")[0] + " Value:" + c.split("=")[1]);
//} //}
//new ProfileFetchTask(app).execute(); //new ProfileFetchTask(app).execute();
} }

View file

@ -0,0 +1,71 @@
package com.github.dfa.diaspora_android.util;
/**
* Created by gregor on 18.09.16.
*/
public class AppLog {
private final static String APP_TAG = "d*";
private static boolean loggingEnabled = true;
private static boolean loggingSpamEnabled = false;
public static boolean isLoggingEnabled() {
return loggingEnabled;
}
public static void setLoggingEnabled(boolean loggingEnabled) {
AppLog.loggingEnabled = loggingEnabled;
}
public static boolean isLoggingSpamEnabled() {
return loggingSpamEnabled;
}
public static void setLoggingSpamEnabled(boolean loggingSpamEnabled) {
AppLog.loggingSpamEnabled = loggingSpamEnabled;
}
private static String getLogPrefix(Object source) {
return APP_TAG + "-" + source.getClass().getCanonicalName();
}
/*
*
* LOGGER METHODS
*
*/
public static void v(Object source, String _text) {
if (isLoggingEnabled()) {
Log.v(getLogPrefix(source), _text);
}
}
public static void i(Object source, String _text) {
if (isLoggingEnabled()) {
Log.i(getLogPrefix(source), _text);
}
}
public static void d(Object source, String _text) {
if (isLoggingEnabled()) {
Log.d(getLogPrefix(source), _text);
}
}
public static void e(Object source, String _text) {
if (isLoggingEnabled()) {
Log.e(getLogPrefix(source), _text);
}
}
public static void w(Object source, String _text) {
if (isLoggingEnabled()) {
Log.w(getLogPrefix(source), _text);
}
}
public static void spam(Object source, String _text) {
if (isLoggingEnabled() && isLoggingSpamEnabled()) {
Log.v(getLogPrefix(source), _text);
}
}
}

View file

@ -10,6 +10,8 @@ import android.support.customtabs.CustomTabsService;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import com.github.dfa.diaspora_android.util.AppLog;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -107,7 +109,7 @@ public class CustomTabsHelper {
return true; return true;
} }
} catch (RuntimeException e) { } catch (RuntimeException e) {
Log.e(TAG, "Runtime exception while getting specialized handlers"); AppLog.e(TAG, "Runtime exception while getting specialized handlers");
} }
return false; return false;
} }

View file

@ -72,7 +72,7 @@ public class Helpers {
// Create an image file name // Create an image file name
String timeStamp = new SimpleDateFormat("dd-MM-yy_HH-mm", Locale.getDefault()).format(new Date()); String timeStamp = new SimpleDateFormat("dd-MM-yy_HH-mm", Locale.getDefault()).format(new Date());
String imageFileName = "JPEG_" + timeStamp + "_"; String imageFileName = "JPEG_" + timeStamp + "_";
Log.d(App.TAG, Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).getAbsolutePath()); AppLog.d(Helpers.class, Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).getAbsolutePath());
File storageDir = Environment.getExternalStoragePublicDirectory( File storageDir = Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_PICTURES); Environment.DIRECTORY_PICTURES);
return new File( return new File(
@ -116,15 +116,15 @@ public class Helpers {
public static void printBundle(Bundle savedInstanceState, String k) { public static void printBundle(Bundle savedInstanceState, String k) {
if (savedInstanceState != null) { if (savedInstanceState != null) {
for (String key : savedInstanceState.keySet()) { for (String key : savedInstanceState.keySet()) {
Log.d("SAVED", key + " is a key in the bundle " + k); AppLog.d("SAVED", key + " is a key in the bundle " + k);
Object bun = savedInstanceState.get(key); Object bun = savedInstanceState.get(key);
if (bun != null) { if (bun != null) {
if (bun instanceof Bundle) { if (bun instanceof Bundle) {
printBundle((Bundle) bun, k + "." + key); printBundle((Bundle) bun, k + "." + key);
} else if (bun instanceof byte[]) { } else if (bun instanceof byte[]) {
Log.d("SAVED", "Key: " + k + "." + key + ": " + Arrays.toString((byte[]) bun)); AppLog.d("SAVED", "Key: " + k + "." + key + ": " + Arrays.toString((byte[]) bun));
} else { } else {
Log.d("SAVED", "Key: " + k + "." + key + ": " + bun.toString()); AppLog.d("SAVED", "Key: " + k + "." + key + ": " + bun.toString());
} }
} }
} }

View file

@ -4,6 +4,7 @@
<!-- Key Names (Untranslatable) --> <!-- Key Names (Untranslatable) -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
<!-- PodProfile --> <!-- PodProfile -->
<!-- More -->
<!-- Category Titles --> <!-- Category Titles -->
<!-- Visuals --> <!-- Visuals -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
@ -11,6 +12,8 @@
<!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash --> <!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash -->
<!-- Load images --> <!-- Load images -->
<!-- Proxy --> <!-- Proxy -->
<!-- Chrome custom tabs -->
<!-- Diaspora Settings --> <!-- Diaspora Settings -->
<!-- More -->
<!-- Recently added - Please move to right section--> <!-- Recently added - Please move to right section-->
</resources> </resources>

View file

@ -9,6 +9,7 @@
<string name="fragment_debug__section_device">Gerät</string> <string name="fragment_debug__section_device">Gerät</string>
<string name="fragment_debug__section_pod">Diaspora Pod</string> <string name="fragment_debug__section_pod">Diaspora Pod</string>
<string name="fragment_debug__section_log">Debug-Protokoll</string> <string name="fragment_debug__section_log">Debug-Protokoll</string>
<string name="fragment_debug__section_log_spam">Debug-Protokoll (Verbose)</string>
<string name="fragment_debug__app_version">App Version: %1$s</string> <string name="fragment_debug__app_version">App Version: %1$s</string>
<string name="fragment_debug__package_name">Paketname: %1$s</string> <string name="fragment_debug__package_name">Paketname: %1$s</string>
<string name="fragment_debug__android_version">Android Version: %1$s</string> <string name="fragment_debug__android_version">Android Version: %1$s</string>

View file

@ -4,6 +4,7 @@
<!-- Key Names (Untranslatable) --> <!-- Key Names (Untranslatable) -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
<!-- PodProfile --> <!-- PodProfile -->
<!-- More -->
<!-- Category Titles --> <!-- Category Titles -->
<string name="pref_cat__visuals">Erscheinungsbild</string> <string name="pref_cat__visuals">Erscheinungsbild</string>
<string name="pref_cat__network">Netzwerk</string> <string name="pref_cat__network">Netzwerk</string>
@ -24,6 +25,9 @@
<string name="pref_desc__proxy_enabled">Nutze einen Proxyserver, um Firewalls zu umgehen</string> <string name="pref_desc__proxy_enabled">Nutze einen Proxyserver, um Firewalls zu umgehen</string>
<string name="pref_title__proxy_host">Host</string> <string name="pref_title__proxy_host">Host</string>
<string name="pref_title__proxy_port">Port</string> <string name="pref_title__proxy_port">Port</string>
<!-- Chrome custom tabs -->
<string name="pref_title__chrome_custom_tabs_enabled">Chrome Custom Tabs</string>
<string name="pref_desc__chrome_custom_tabs_enabled">Externe Links mit Chrome Custom Tabs öffnen. Für dieses Feature muss Chromium oder Google Chrome installiert sein</string>
<!-- Diaspora Settings --> <!-- Diaspora Settings -->
<string name="pref_title__personal_settings">Persönliche Einstellungen</string> <string name="pref_title__personal_settings">Persönliche Einstellungen</string>
<string name="pref_desc__personal_settings">Öffne die Einstellungen deines Diaspora Accounts</string> <string name="pref_desc__personal_settings">Öffne die Einstellungen deines Diaspora Accounts</string>
@ -40,5 +44,6 @@
<string name="pref_title__intellihide_toolbars">Werkzeugleisten intelligent verstecken</string> <string name="pref_title__intellihide_toolbars">Werkzeugleisten intelligent verstecken</string>
<string name="pref_title__append_shared_via_app">Verweise auf App</string> <string name="pref_title__append_shared_via_app">Verweise auf App</string>
<string name="pref_desc__append_shared_via_app">Füge beim Teilen von Texten einen Verweis auf diese App an (\"geteilt durch&#8230;\")</string> <string name="pref_desc__append_shared_via_app">Füge beim Teilen von Texten einen Verweis auf diese App an (\"geteilt durch&#8230;\")</string>
<!-- More -->
<!-- Recently added - Please move to right section--> <!-- Recently added - Please move to right section-->
</resources> </resources>

View file

@ -4,6 +4,7 @@
<!-- Key Names (Untranslatable) --> <!-- Key Names (Untranslatable) -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
<!-- PodProfile --> <!-- PodProfile -->
<!-- More -->
<!-- Category Titles --> <!-- Category Titles -->
<!-- Visuals --> <!-- Visuals -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
@ -11,6 +12,8 @@
<!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash --> <!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash -->
<!-- Load images --> <!-- Load images -->
<!-- Proxy --> <!-- Proxy -->
<!-- Chrome custom tabs -->
<!-- Diaspora Settings --> <!-- Diaspora Settings -->
<!-- More -->
<!-- Recently added - Please move to right section--> <!-- Recently added - Please move to right section-->
</resources> </resources>

View file

@ -4,6 +4,7 @@
<!-- Key Names (Untranslatable) --> <!-- Key Names (Untranslatable) -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
<!-- PodProfile --> <!-- PodProfile -->
<!-- More -->
<!-- Category Titles --> <!-- Category Titles -->
<string name="pref_cat__visuals">Aspecto</string> <string name="pref_cat__visuals">Aspecto</string>
<string name="pref_cat__network">Red</string> <string name="pref_cat__network">Red</string>
@ -24,6 +25,7 @@
<string name="pref_desc__proxy_enabled">El tráfico proxificado de Diaspora para evitar firewalls.\nPuede necesitar reiniciarse</string> <string name="pref_desc__proxy_enabled">El tráfico proxificado de Diaspora para evitar firewalls.\nPuede necesitar reiniciarse</string>
<string name="pref_title__proxy_host">Anfitrión</string> <string name="pref_title__proxy_host">Anfitrión</string>
<string name="pref_title__proxy_port">Puerto</string> <string name="pref_title__proxy_port">Puerto</string>
<!-- Chrome custom tabs -->
<!-- Diaspora Settings --> <!-- Diaspora Settings -->
<string name="pref_title__personal_settings">Configuración personal</string> <string name="pref_title__personal_settings">Configuración personal</string>
<string name="pref_title__manage_contacts">Contactos</string> <string name="pref_title__manage_contacts">Contactos</string>
@ -39,5 +41,6 @@
<string name="pref_title__intellihide_toolbars">Barras de herramientas Intellihide</string> <string name="pref_title__intellihide_toolbars">Barras de herramientas Intellihide</string>
<string name="pref_title__append_shared_via_app">Añadir compartido por aviso</string> <string name="pref_title__append_shared_via_app">Añadir compartido por aviso</string>
<string name="pref_desc__append_shared_via_app">Agregar una referencia a esta aplicación (\"compartida por&#8230;\") a los textos compartidos</string> <string name="pref_desc__append_shared_via_app">Agregar una referencia a esta aplicación (\"compartida por&#8230;\") a los textos compartidos</string>
<!-- More -->
<!-- Recently added - Please move to right section--> <!-- Recently added - Please move to right section-->
</resources> </resources>

View file

@ -4,6 +4,7 @@
<!-- Key Names (Untranslatable) --> <!-- Key Names (Untranslatable) -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
<!-- PodProfile --> <!-- PodProfile -->
<!-- More -->
<!-- Category Titles --> <!-- Category Titles -->
<string name="pref_cat__visuals">Apparence</string> <string name="pref_cat__visuals">Apparence</string>
<string name="pref_cat__network">Paramètres du réseau</string> <string name="pref_cat__network">Paramètres du réseau</string>
@ -24,6 +25,7 @@
<string name="pref_desc__proxy_enabled">Serveur Proxy.\n(Nécessite un redémarrage)</string> <string name="pref_desc__proxy_enabled">Serveur Proxy.\n(Nécessite un redémarrage)</string>
<string name="pref_title__proxy_host">Hôte</string> <string name="pref_title__proxy_host">Hôte</string>
<string name="pref_title__proxy_port">Port</string> <string name="pref_title__proxy_port">Port</string>
<!-- Chrome custom tabs -->
<!-- Diaspora Settings --> <!-- Diaspora Settings -->
<string name="pref_title__personal_settings">Paramètres personnels</string> <string name="pref_title__personal_settings">Paramètres personnels</string>
<string name="pref_desc__personal_settings">Ouvrir vos paramètres de compte diaspora</string> <string name="pref_desc__personal_settings">Ouvrir vos paramètres de compte diaspora</string>
@ -40,5 +42,6 @@
<string name="pref_title__intellihide_toolbars">Masquage intelligent des barres d\'outils</string> <string name="pref_title__intellihide_toolbars">Masquage intelligent des barres d\'outils</string>
<string name="pref_title__append_shared_via_app">Ajoutez \"partagé via …\" aux partages</string> <string name="pref_title__append_shared_via_app">Ajoutez \"partagé via …\" aux partages</string>
<string name="pref_desc__append_shared_via_app">Ajoutez une référence à l\'application (« partagée via &#8230;\") aux textes partagés</string> <string name="pref_desc__append_shared_via_app">Ajoutez une référence à l\'application (« partagée via &#8230;\") aux textes partagés</string>
<!-- More -->
<!-- Recently added - Please move to right section--> <!-- Recently added - Please move to right section-->
</resources> </resources>

View file

@ -4,6 +4,7 @@
<!-- Key Names (Untranslatable) --> <!-- Key Names (Untranslatable) -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
<!-- PodProfile --> <!-- PodProfile -->
<!-- More -->
<!-- Category Titles --> <!-- Category Titles -->
<!-- Visuals --> <!-- Visuals -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
@ -11,6 +12,8 @@
<!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash --> <!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash -->
<!-- Load images --> <!-- Load images -->
<!-- Proxy --> <!-- Proxy -->
<!-- Chrome custom tabs -->
<!-- Diaspora Settings --> <!-- Diaspora Settings -->
<!-- More -->
<!-- Recently added - Please move to right section--> <!-- Recently added - Please move to right section-->
</resources> </resources>

View file

@ -4,6 +4,7 @@
<!-- Key Names (Untranslatable) --> <!-- Key Names (Untranslatable) -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
<!-- PodProfile --> <!-- PodProfile -->
<!-- More -->
<!-- Category Titles --> <!-- Category Titles -->
<!-- Visuals --> <!-- Visuals -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
@ -11,6 +12,8 @@
<!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash --> <!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash -->
<!-- Load images --> <!-- Load images -->
<!-- Proxy --> <!-- Proxy -->
<!-- Chrome custom tabs -->
<!-- Diaspora Settings --> <!-- Diaspora Settings -->
<!-- More -->
<!-- Recently added - Please move to right section--> <!-- Recently added - Please move to right section-->
</resources> </resources>

View file

@ -4,6 +4,7 @@
<!-- Key Names (Untranslatable) --> <!-- Key Names (Untranslatable) -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
<!-- PodProfile --> <!-- PodProfile -->
<!-- More -->
<!-- Category Titles --> <!-- Category Titles -->
<string name="pref_cat__visuals">Aspetto</string> <string name="pref_cat__visuals">Aspetto</string>
<string name="pref_cat__network">Rete</string> <string name="pref_cat__network">Rete</string>
@ -24,6 +25,7 @@
<string name="pref_desc__proxy_enabled">Traffico del proxy di Diaspora per bypassare i firewall.\nPuò essere necessario il riavvio dell\'app</string> <string name="pref_desc__proxy_enabled">Traffico del proxy di Diaspora per bypassare i firewall.\nPuò essere necessario il riavvio dell\'app</string>
<string name="pref_title__proxy_host">Host</string> <string name="pref_title__proxy_host">Host</string>
<string name="pref_title__proxy_port">Porta</string> <string name="pref_title__proxy_port">Porta</string>
<!-- Chrome custom tabs -->
<!-- Diaspora Settings --> <!-- Diaspora Settings -->
<string name="pref_title__personal_settings">Impostazioni personali</string> <string name="pref_title__personal_settings">Impostazioni personali</string>
<string name="pref_desc__personal_settings">Apri le impostazioni del tuo account Diaspora</string> <string name="pref_desc__personal_settings">Apri le impostazioni del tuo account Diaspora</string>
@ -40,5 +42,6 @@
<string name="pref_title__intellihide_toolbars">Barre che si nascondono intelligentemente</string> <string name="pref_title__intellihide_toolbars">Barre che si nascondono intelligentemente</string>
<string name="pref_title__append_shared_via_app">Aggiungi avviso dell\'app</string> <string name="pref_title__append_shared_via_app">Aggiungi avviso dell\'app</string>
<string name="pref_desc__append_shared_via_app">Aggiunge un riferimento a quest\'app (\"Condiviso da&#8230;\") nei testi condivisi</string> <string name="pref_desc__append_shared_via_app">Aggiunge un riferimento a quest\'app (\"Condiviso da&#8230;\") nei testi condivisi</string>
<!-- More -->
<!-- Recently added - Please move to right section--> <!-- Recently added - Please move to right section-->
</resources> </resources>

View file

@ -4,6 +4,7 @@
<!-- Key Names (Untranslatable) --> <!-- Key Names (Untranslatable) -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
<!-- PodProfile --> <!-- PodProfile -->
<!-- More -->
<!-- Category Titles --> <!-- Category Titles -->
<string name="pref_cat__visuals">外観</string> <string name="pref_cat__visuals">外観</string>
<string name="pref_cat__network">ネットワーク</string> <string name="pref_cat__network">ネットワーク</string>
@ -24,6 +25,7 @@
<string name="pref_desc__proxy_enabled">Diaspora の通信をプロキシして、ファイアウォールに回避します。\n再起動が必要になることがあります</string> <string name="pref_desc__proxy_enabled">Diaspora の通信をプロキシして、ファイアウォールに回避します。\n再起動が必要になることがあります</string>
<string name="pref_title__proxy_host">ホスト</string> <string name="pref_title__proxy_host">ホスト</string>
<string name="pref_title__proxy_port">ポート</string> <string name="pref_title__proxy_port">ポート</string>
<!-- Chrome custom tabs -->
<!-- Diaspora Settings --> <!-- Diaspora Settings -->
<string name="pref_title__personal_settings">個人用設定</string> <string name="pref_title__personal_settings">個人用設定</string>
<string name="pref_desc__personal_settings">Diaspora アカウント設定を開きます</string> <string name="pref_desc__personal_settings">Diaspora アカウント設定を開きます</string>
@ -40,5 +42,6 @@
<string name="pref_title__intellihide_toolbars">Intellihide ツールバー</string> <string name="pref_title__intellihide_toolbars">Intellihide ツールバー</string>
<string name="pref_title__append_shared_via_app">共有方法の通知を追加</string> <string name="pref_title__append_shared_via_app">共有方法の通知を追加</string>
<string name="pref_desc__append_shared_via_app">共有テキストに、このアプリへの参照 (\"&#8230;で共有\") を追加します</string> <string name="pref_desc__append_shared_via_app">共有テキストに、このアプリへの参照 (\"&#8230;で共有\") を追加します</string>
<!-- More -->
<!-- Recently added - Please move to right section--> <!-- Recently added - Please move to right section-->
</resources> </resources>

View file

@ -4,6 +4,7 @@
<!-- Key Names (Untranslatable) --> <!-- Key Names (Untranslatable) -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
<!-- PodProfile --> <!-- PodProfile -->
<!-- More -->
<!-- Category Titles --> <!-- Category Titles -->
<!-- Visuals --> <!-- Visuals -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
@ -11,6 +12,8 @@
<!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash --> <!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash -->
<!-- Load images --> <!-- Load images -->
<!-- Proxy --> <!-- Proxy -->
<!-- Chrome custom tabs -->
<!-- Diaspora Settings --> <!-- Diaspora Settings -->
<!-- More -->
<!-- Recently added - Please move to right section--> <!-- Recently added - Please move to right section-->
</resources> </resources>

View file

@ -4,6 +4,7 @@
<!-- Key Names (Untranslatable) --> <!-- Key Names (Untranslatable) -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
<!-- PodProfile --> <!-- PodProfile -->
<!-- More -->
<!-- Category Titles --> <!-- Category Titles -->
<string name="pref_cat__visuals">കാഴ്ച്ച</string> <string name="pref_cat__visuals">കാഴ്ച്ച</string>
<string name="pref_cat__network">ശൃങ്കല</string> <string name="pref_cat__network">ശൃങ്കല</string>
@ -24,6 +25,7 @@
<string name="pref_desc__proxy_enabled">ഫയർവാളുകളെ മറികടക്കാൻ ഡയസ്പോറ ട്രാഫിക് പ്രോക്സി ചെയ്യൂ.\nപുനരാരഭിക്കേണ്ടി വന്നേക്കാം</string> <string name="pref_desc__proxy_enabled">ഫയർവാളുകളെ മറികടക്കാൻ ഡയസ്പോറ ട്രാഫിക് പ്രോക്സി ചെയ്യൂ.\nപുനരാരഭിക്കേണ്ടി വന്നേക്കാം</string>
<string name="pref_title__proxy_host">ആഥിതേയൻ</string> <string name="pref_title__proxy_host">ആഥിതേയൻ</string>
<string name="pref_title__proxy_port">പോർട്ട്</string> <string name="pref_title__proxy_port">പോർട്ട്</string>
<!-- Chrome custom tabs -->
<!-- Diaspora Settings --> <!-- Diaspora Settings -->
<string name="pref_title__personal_settings">സ്വകാര്യ സജ്ജീകരണങ്ങൾ</string> <string name="pref_title__personal_settings">സ്വകാര്യ സജ്ജീകരണങ്ങൾ</string>
<string name="pref_title__manage_contacts">ബന്ധങ്ങൾ</string> <string name="pref_title__manage_contacts">ബന്ധങ്ങൾ</string>
@ -39,5 +41,6 @@
<string name="pref_title__intellihide_toolbars">ടൂൾബാറുകൾ ഇന്റലിഹൈഡ് ചെയ്യുക</string> <string name="pref_title__intellihide_toolbars">ടൂൾബാറുകൾ ഇന്റലിഹൈഡ് ചെയ്യുക</string>
<string name="pref_title__append_shared_via_app">അറിയിപ്പാൽ പങ്കുവച്ചത് എന്ന് കൂട്ടിച്ചേർക്കുക</string> <string name="pref_title__append_shared_via_app">അറിയിപ്പാൽ പങ്കുവച്ചത് എന്ന് കൂട്ടിച്ചേർക്കുക</string>
<string name="pref_desc__append_shared_via_app">പങ്കുവയ്ക്കുന്ന വാചകങ്ങളിൽ ഈ പ്രയോഗത്തിന്റെ അവലംബം(\"&#8230;പങ്കുവച്ചത്\") എന്ന് കൂട്ടിച്ചേർക്കുക</string> <string name="pref_desc__append_shared_via_app">പങ്കുവയ്ക്കുന്ന വാചകങ്ങളിൽ ഈ പ്രയോഗത്തിന്റെ അവലംബം(\"&#8230;പങ്കുവച്ചത്\") എന്ന് കൂട്ടിച്ചേർക്കുക</string>
<!-- More -->
<!-- Recently added - Please move to right section--> <!-- Recently added - Please move to right section-->
</resources> </resources>

View file

@ -4,6 +4,7 @@
<!-- Key Names (Untranslatable) --> <!-- Key Names (Untranslatable) -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
<!-- PodProfile --> <!-- PodProfile -->
<!-- More -->
<!-- Category Titles --> <!-- Category Titles -->
<string name="pref_cat__visuals">Vormgeving</string> <string name="pref_cat__visuals">Vormgeving</string>
<string name="pref_cat__network">Netwerk</string> <string name="pref_cat__network">Netwerk</string>
@ -23,6 +24,7 @@
<string name="pref_desc__proxy_enabled">Gebruik een Proxy voor Diaspora om de firewalls te omzeilen.\nRestart nodig</string> <string name="pref_desc__proxy_enabled">Gebruik een Proxy voor Diaspora om de firewalls te omzeilen.\nRestart nodig</string>
<string name="pref_title__proxy_host">Host</string> <string name="pref_title__proxy_host">Host</string>
<string name="pref_title__proxy_port">Poort</string> <string name="pref_title__proxy_port">Poort</string>
<!-- Chrome custom tabs -->
<!-- Diaspora Settings --> <!-- Diaspora Settings -->
<string name="pref_title__personal_settings">Persoonlijke instellingen</string> <string name="pref_title__personal_settings">Persoonlijke instellingen</string>
<string name="pref_title__manage_contacts">Contacten</string> <string name="pref_title__manage_contacts">Contacten</string>
@ -38,5 +40,6 @@
<string name="pref_title__intellihide_toolbars">Werkbalken slim wegwerken</string> <string name="pref_title__intellihide_toolbars">Werkbalken slim wegwerken</string>
<string name="pref_title__append_shared_via_app">Gedeeld-via-aankondiging toevoegen</string> <string name="pref_title__append_shared_via_app">Gedeeld-via-aankondiging toevoegen</string>
<string name="pref_desc__append_shared_via_app">Een verwijzing naar dit app (\"gedeeld door&#8230;\") toevoegen aan gedeelde teksten</string> <string name="pref_desc__append_shared_via_app">Een verwijzing naar dit app (\"gedeeld door&#8230;\") toevoegen aan gedeelde teksten</string>
<!-- More -->
<!-- Recently added - Please move to right section--> <!-- Recently added - Please move to right section-->
</resources> </resources>

View file

@ -4,6 +4,7 @@
<!-- Key Names (Untranslatable) --> <!-- Key Names (Untranslatable) -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
<!-- PodProfile --> <!-- PodProfile -->
<!-- More -->
<!-- Category Titles --> <!-- Category Titles -->
<!-- Visuals --> <!-- Visuals -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
@ -11,6 +12,8 @@
<!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash --> <!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash -->
<!-- Load images --> <!-- Load images -->
<!-- Proxy --> <!-- Proxy -->
<!-- Chrome custom tabs -->
<!-- Diaspora Settings --> <!-- Diaspora Settings -->
<!-- More -->
<!-- Recently added - Please move to right section--> <!-- Recently added - Please move to right section-->
</resources> </resources>

View file

@ -4,6 +4,7 @@
<!-- Key Names (Untranslatable) --> <!-- Key Names (Untranslatable) -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
<!-- PodProfile --> <!-- PodProfile -->
<!-- More -->
<!-- Category Titles --> <!-- Category Titles -->
<string name="pref_cat__visuals">Wygląd</string> <string name="pref_cat__visuals">Wygląd</string>
<string name="pref_cat__network">Sieć</string> <string name="pref_cat__network">Sieć</string>
@ -17,6 +18,7 @@
<string name="pref_title__load_images">Załaduj obrazy</string> <string name="pref_title__load_images">Załaduj obrazy</string>
<!-- Proxy --> <!-- Proxy -->
<string name="pref_title__proxy_enabled">Włącz serwer Proxy</string> <string name="pref_title__proxy_enabled">Włącz serwer Proxy</string>
<!-- Chrome custom tabs -->
<!-- Diaspora Settings --> <!-- Diaspora Settings -->
<string name="pref_title__personal_settings">Ustawienia osobiste</string> <string name="pref_title__personal_settings">Ustawienia osobiste</string>
<string name="pref_title__manage_contacts">Kontakty</string> <string name="pref_title__manage_contacts">Kontakty</string>
@ -27,5 +29,6 @@
<string name="pref_title__clear_cache">Wyczyść pamięć podręczną</string> <string name="pref_title__clear_cache">Wyczyść pamięć podręczną</string>
<string name="pref_desc__clear_cache">Wyczyść pamięć podręczną WebView</string> <string name="pref_desc__clear_cache">Wyczyść pamięć podręczną WebView</string>
<string name="pref_desc__intellihide_toolbars">Automatycznie ukryj paski narzędzi na górze i na dole podczas przewijania</string> <string name="pref_desc__intellihide_toolbars">Automatycznie ukryj paski narzędzi na górze i na dole podczas przewijania</string>
<!-- More -->
<!-- Recently added - Please move to right section--> <!-- Recently added - Please move to right section-->
</resources> </resources>

View file

@ -4,6 +4,7 @@
<!-- Key Names (Untranslatable) --> <!-- Key Names (Untranslatable) -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
<!-- PodProfile --> <!-- PodProfile -->
<!-- More -->
<!-- Category Titles --> <!-- Category Titles -->
<string name="pref_cat__visuals">Aparência</string> <string name="pref_cat__visuals">Aparência</string>
<string name="pref_cat__network">Rede</string> <string name="pref_cat__network">Rede</string>
@ -24,6 +25,7 @@
<string name="pref_desc__proxy_enabled">Usar proxy para o tráfego da diáspora para contornar firewalls.\nPode requerer reinicialização</string> <string name="pref_desc__proxy_enabled">Usar proxy para o tráfego da diáspora para contornar firewalls.\nPode requerer reinicialização</string>
<string name="pref_title__proxy_host">Servidor</string> <string name="pref_title__proxy_host">Servidor</string>
<string name="pref_title__proxy_port">Porta</string> <string name="pref_title__proxy_port">Porta</string>
<!-- Chrome custom tabs -->
<!-- Diaspora Settings --> <!-- Diaspora Settings -->
<string name="pref_title__personal_settings">Configurações pessoais</string> <string name="pref_title__personal_settings">Configurações pessoais</string>
<string name="pref_title__manage_contacts">Contatos</string> <string name="pref_title__manage_contacts">Contatos</string>
@ -39,5 +41,6 @@
<string name="pref_title__intellihide_toolbars">Barras de ferramentas auto ocultante</string> <string name="pref_title__intellihide_toolbars">Barras de ferramentas auto ocultante</string>
<string name="pref_title__append_shared_via_app">Acrescentar compartilhado-por-aviso</string> <string name="pref_title__append_shared_via_app">Acrescentar compartilhado-por-aviso</string>
<string name="pref_desc__append_shared_via_app">Acrescentar uma referência (\"compartilhado por&#8230;\") a este app para textos compartilhados</string> <string name="pref_desc__append_shared_via_app">Acrescentar uma referência (\"compartilhado por&#8230;\") a este app para textos compartilhados</string>
<!-- More -->
<!-- Recently added - Please move to right section--> <!-- Recently added - Please move to right section-->
</resources> </resources>

View file

@ -4,6 +4,7 @@
<!-- Key Names (Untranslatable) --> <!-- Key Names (Untranslatable) -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
<!-- PodProfile --> <!-- PodProfile -->
<!-- More -->
<!-- Category Titles --> <!-- Category Titles -->
<!-- Visuals --> <!-- Visuals -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
@ -11,6 +12,8 @@
<!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash --> <!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash -->
<!-- Load images --> <!-- Load images -->
<!-- Proxy --> <!-- Proxy -->
<!-- Chrome custom tabs -->
<!-- Diaspora Settings --> <!-- Diaspora Settings -->
<!-- More -->
<!-- Recently added - Please move to right section--> <!-- Recently added - Please move to right section-->
</resources> </resources>

View file

@ -4,6 +4,7 @@
<!-- Key Names (Untranslatable) --> <!-- Key Names (Untranslatable) -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
<!-- PodProfile --> <!-- PodProfile -->
<!-- More -->
<!-- Category Titles --> <!-- Category Titles -->
<string name="pref_cat__visuals">Внешний вид</string> <string name="pref_cat__visuals">Внешний вид</string>
<string name="pref_cat__network">Сеть</string> <string name="pref_cat__network">Сеть</string>
@ -24,6 +25,7 @@
<string name="pref_desc__proxy_enabled">Перенаправить трафик Диаспоры в обход брандмауэров.\nМожет потребовать перезапуска</string> <string name="pref_desc__proxy_enabled">Перенаправить трафик Диаспоры в обход брандмауэров.\nМожет потребовать перезапуска</string>
<string name="pref_title__proxy_host">Хост</string> <string name="pref_title__proxy_host">Хост</string>
<string name="pref_title__proxy_port">Порт</string> <string name="pref_title__proxy_port">Порт</string>
<!-- Chrome custom tabs -->
<!-- Diaspora Settings --> <!-- Diaspora Settings -->
<string name="pref_title__personal_settings">Личные настройки</string> <string name="pref_title__personal_settings">Личные настройки</string>
<string name="pref_title__manage_contacts">Контакты</string> <string name="pref_title__manage_contacts">Контакты</string>
@ -39,5 +41,6 @@
<string name="pref_title__intellihide_toolbars">Интеллектуальное скрытие панелей инструментов</string> <string name="pref_title__intellihide_toolbars">Интеллектуальное скрытие панелей инструментов</string>
<string name="pref_title__append_shared_via_app">Присоединять \"Опубликовано из\" к сообщению</string> <string name="pref_title__append_shared_via_app">Присоединять \"Опубликовано из\" к сообщению</string>
<string name="pref_desc__append_shared_via_app">Присоединять ссылку на приложение (\"Опубликовано из&#8230;\") к размещенным записям</string> <string name="pref_desc__append_shared_via_app">Присоединять ссылку на приложение (\"Опубликовано из&#8230;\") к размещенным записям</string>
<!-- More -->
<!-- Recently added - Please move to right section--> <!-- Recently added - Please move to right section-->
</resources> </resources>

View file

@ -4,6 +4,7 @@
<!-- Key Names (Untranslatable) --> <!-- Key Names (Untranslatable) -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
<!-- PodProfile --> <!-- PodProfile -->
<!-- More -->
<!-- Category Titles --> <!-- Category Titles -->
<!-- Visuals --> <!-- Visuals -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
@ -11,6 +12,8 @@
<!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash --> <!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash -->
<!-- Load images --> <!-- Load images -->
<!-- Proxy --> <!-- Proxy -->
<!-- Chrome custom tabs -->
<!-- Diaspora Settings --> <!-- Diaspora Settings -->
<!-- More -->
<!-- Recently added - Please move to right section--> <!-- Recently added - Please move to right section-->
</resources> </resources>

View file

@ -4,6 +4,7 @@
<!-- Key Names (Untranslatable) --> <!-- Key Names (Untranslatable) -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
<!-- PodProfile --> <!-- PodProfile -->
<!-- More -->
<!-- Category Titles --> <!-- Category Titles -->
<!-- Visuals --> <!-- Visuals -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
@ -11,6 +12,8 @@
<!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash --> <!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash -->
<!-- Load images --> <!-- Load images -->
<!-- Proxy --> <!-- Proxy -->
<!-- Chrome custom tabs -->
<!-- Diaspora Settings --> <!-- Diaspora Settings -->
<!-- More -->
<!-- Recently added - Please move to right section--> <!-- Recently added - Please move to right section-->
</resources> </resources>

View file

@ -14,6 +14,7 @@
<string name="fragment_debug__section_device">Device</string> <string name="fragment_debug__section_device">Device</string>
<string name="fragment_debug__section_pod">Diaspora Pod</string> <string name="fragment_debug__section_pod">Diaspora Pod</string>
<string name="fragment_debug__section_log">Debug Log</string> <string name="fragment_debug__section_log">Debug Log</string>
<string name="fragment_debug__section_log_spam">Debug Log (Verbose)</string>
<string name="fragment_debug__app_version">App Version: %1$s</string> <string name="fragment_debug__app_version">App Version: %1$s</string>
<string name="fragment_debug__package_name">Package Name: %1$s</string> <string name="fragment_debug__package_name">Package Name: %1$s</string>
<string name="fragment_debug__android_version">Android Version: %1$s</string> <string name="fragment_debug__android_version">Android Version: %1$s</string>

View file

@ -14,7 +14,7 @@
<string name="pref_catkey__network" translatable="false">pref_key_category_network</string> <string name="pref_catkey__network" translatable="false">pref_key_category_network</string>
<string name="pref_key__load_images" translatable="false">pref_key_load_images</string> <string name="pref_key__load_images" translatable="false">pref_key_load_images</string>
<string name="pref_key__clear_cache" translatable="false">pref_key_clear_cache</string> <string name="pref_key__clear_cache" translatable="false">pref_key_clear_cache</string>
<string name="pref_key__chrome_custom_tabs_enabled">pref_key__chrome_custom_tabs_enabled</string> <string name="pref_key__chrome_custom_tabs_enabled" translatable="false">pref_key__chrome_custom_tabs_enabled</string>
<string name="pref_key__append_shared_via_app" translatable="false">pref_key_append_shared_via_app</string> <string name="pref_key__append_shared_via_app" translatable="false">pref_key_append_shared_via_app</string>
<string name="pref_key__proxy_enabled" translatable="false">pref_key_proxy_enabled</string> <string name="pref_key__proxy_enabled" translatable="false">pref_key_proxy_enabled</string>
@ -35,7 +35,6 @@
<string name="pref_key__visibility_nav__followed_tags" translatable="false">pref_key__visibility_nav__followed_tags</string> <string name="pref_key__visibility_nav__followed_tags" translatable="false">pref_key__visibility_nav__followed_tags</string>
<string name="pref_key__visibility_nav__profile" translatable="false">pref_key__visibility_nav__profile</string> <string name="pref_key__visibility_nav__profile" translatable="false">pref_key__visibility_nav__profile</string>
<!-- PodProfile --> <!-- PodProfile -->
<string name="pref_key__podprofile_avatar_url" translatable="false">podUserProfile_avatar</string> <string name="pref_key__podprofile_avatar_url" translatable="false">podUserProfile_avatar</string>
<string name="pref_key__podprofile_name" translatable="false">podUserProfile_name</string> <string name="pref_key__podprofile_name" translatable="false">podUserProfile_name</string>
@ -45,11 +44,16 @@
<string name="pref_key__podprofile_unread_message_count" translatable="false">podUserProfile_unreadMessageCount</string> <string name="pref_key__podprofile_unread_message_count" translatable="false">podUserProfile_unreadMessageCount</string>
<string name="pref_key__podprofile_notification_count" translatable="false">podUserProfile_NotificationCount</string> <string name="pref_key__podprofile_notification_count" translatable="false">podUserProfile_NotificationCount</string>
<!-- More -->
<string name="pref_catkey__category_more" translatable="false">pref_catkey__category_more</string>
<string name="pref_key__logging_spam_enabled" translatable="false">pref_key__logging_spam_enabled</string>
<string name="pref_key__logging_enabled" translatable="false">pref_key__logging_enabled</string>
<!-- Category Titles --> <!-- Category Titles -->
<string name="pref_cat__visuals">Appearance</string> <string name="pref_cat__visuals">Appearance</string>
<string name="pref_cat__network">Network</string> <string name="pref_cat__network">Network</string>
<string name="pref_cat__pod_settings">Pod settings</string> <string name="pref_cat__pod_settings">Pod settings</string>
<string name="pref_cat__more" translatable="false">@string/nav_menu_more</string>
<!-- Visuals --> <!-- Visuals -->
<!-- Navigiation Slider --> <!-- Navigiation Slider -->
@ -110,5 +114,14 @@
<string name="pref_title__append_shared_via_app">Append shared-by-notice</string> <string name="pref_title__append_shared_via_app">Append shared-by-notice</string>
<string name="pref_desc__append_shared_via_app">Append a reference to this app ("shared by…") to shared texts</string> <string name="pref_desc__append_shared_via_app">Append a reference to this app ("shared by…") to shared texts</string>
<!-- More -->
<string name="pref_title__sub_logging" translatable="false">@string/about_activity__title_debug_info</string>
<string name="pref_desc__sub_logging" translatable="false">@string/fragment_debug__section_log</string>
<string name="pref_title__logging_enabled" translatable="false">@string/fragment_debug__section_log</string>
<string name="pref_title__logging_spam_enabled" translatable="false">@string/fragment_debug__section_log_spam</string>
<!-- Recently added - Please move to right section--> <!-- Recently added - Please move to right section-->
</resources> </resources>

View file

@ -141,4 +141,27 @@
android:key="@string/pref_key__proxy_port" android:key="@string/pref_key__proxy_port"
android:title="@string/pref_title__proxy_port"/> android:title="@string/pref_title__proxy_port"/>
</PreferenceCategory> </PreferenceCategory>
<!-- More -->
<PreferenceCategory
android:key="@string/pref_catkey__category_more"
android:title="@string/pref_cat__more">
<PreferenceScreen
android:summary="@string/pref_desc__sub_logging"
android:title="@string/pref_title__sub_logging">
<CheckBoxPreference
android:defaultValue="true"
android:key="@string/pref_key__logging_enabled"
android:title="@string/pref_title__logging_enabled"/>
<CheckBoxPreference
android:defaultValue="true"
android:key="@string/pref_key__logging_spam_enabled"
android:title="@string/pref_title__logging_spam_enabled"/>
</PreferenceScreen>
</PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>