mirror of
https://github.com/gsantner/dandelion
synced 2024-11-21 20:02:07 +01:00
Move Logging to own class; Allow disable normal&spam messages
This commit is contained in:
parent
67c416f870
commit
ed55459019
40 changed files with 368 additions and 166 deletions
|
@ -41,7 +41,7 @@
|
|||
android:name=".activity.SettingsActivity"
|
||||
android:launchMode="singleInstance"
|
||||
android:theme="@style/AppTheme"
|
||||
android:label="@string/pref_title__personal_settings">
|
||||
android:label="@string/settings">
|
||||
</activity>
|
||||
|
||||
<service
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
package com.github.dfa.diaspora_android;
|
||||
|
||||
import android.app.Application;
|
||||
|
@ -29,11 +29,11 @@ import android.webkit.WebView;
|
|||
|
||||
import com.github.dfa.diaspora_android.data.AppSettings;
|
||||
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.DiasporaUrlHelper;
|
||||
|
||||
public class App extends Application {
|
||||
public static final String TAG = "DIASPORA_";
|
||||
|
||||
private AppSettings appSettings;
|
||||
private AvatarImageLoader avatarImageLoader;
|
||||
|
@ -45,6 +45,12 @@ public class App extends Application {
|
|||
super.onCreate();
|
||||
final Context c = getApplicationContext();
|
||||
appSettings = new AppSettings(c);
|
||||
|
||||
// Init app log
|
||||
AppLog.setLoggingEnabled(appSettings.isLoggingEnabled());
|
||||
AppLog.setLoggingSpamEnabled(appSettings.isLoggingSpamEnabled());
|
||||
|
||||
// Init pod profile
|
||||
avatarImageLoader = new AvatarImageLoader(c);
|
||||
podUserProfile = new PodUserProfile(this);
|
||||
|
||||
|
@ -58,8 +64,8 @@ public class App extends Application {
|
|||
cookieManager.setAcceptCookie(true);
|
||||
}
|
||||
|
||||
public void resetPodData(@Nullable WebView webView){
|
||||
if(webView != null){
|
||||
public void resetPodData(@Nullable WebView webView) {
|
||||
if (webView != null) {
|
||||
webView.stopLoading();
|
||||
webView.loadUrl(DiasporaUrlHelper.URL_BLANK);
|
||||
webView.clearFormData();
|
||||
|
@ -81,7 +87,7 @@ public class App extends Application {
|
|||
}
|
||||
}
|
||||
|
||||
public PodUserProfile getPodUserProfile(){
|
||||
public PodUserProfile getPodUserProfile() {
|
||||
return podUserProfile;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,10 +44,10 @@ import com.github.dfa.diaspora_android.App;
|
|||
import com.github.dfa.diaspora_android.R;
|
||||
import com.github.dfa.diaspora_android.data.AppSettings;
|
||||
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.Log;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Observable;
|
||||
import java.util.Observer;
|
||||
|
||||
|
@ -94,7 +94,7 @@ public class AboutActivity extends AppCompatActivity {
|
|||
tabLayout.setupWithViewPager(mViewPager);
|
||||
|
||||
//Apply intellihide
|
||||
if(!((App)getApplication()).getSettings().isIntellihideToolbars()) {
|
||||
if (!((App) getApplication()).getSettings().isIntellihideToolbars()) {
|
||||
AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) linearLayout.getLayoutParams();
|
||||
params.setScrollFlags(0);
|
||||
}
|
||||
|
@ -194,6 +194,7 @@ public class AboutActivity extends AppCompatActivity {
|
|||
*/
|
||||
public static class DebugFragment extends Fragment implements Observer {
|
||||
private TextView logBox;
|
||||
|
||||
public DebugFragment() {
|
||||
}
|
||||
|
||||
|
@ -210,14 +211,15 @@ public class AboutActivity extends AppCompatActivity {
|
|||
logBox.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View view) {
|
||||
Log.d(App.TAG, "Long click registered");
|
||||
if(isAdded()) {
|
||||
AppLog.d(this, "Long click registered");
|
||||
if (isAdded()) {
|
||||
ClipboardManager clipboard = (ClipboardManager) getActivity().getSystemService(CLIPBOARD_SERVICE);
|
||||
ClipData clip = ClipData.newPlainText("DEBUG_LOG", Log.getLogBuffer());
|
||||
clipboard.setPrimaryClip(clip);
|
||||
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;
|
||||
}
|
||||
});
|
||||
|
@ -233,7 +235,7 @@ public class AboutActivity extends AppCompatActivity {
|
|||
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));
|
||||
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()));
|
||||
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
|
@ -252,7 +254,7 @@ public class AboutActivity extends AppCompatActivity {
|
|||
|
||||
@Override
|
||||
public void update(Observable observable, Object o) {
|
||||
if(logBox != null) {
|
||||
if (logBox != null) {
|
||||
logBox.setText(Log.getLogBuffer());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,8 +26,6 @@ import android.app.AlarmManager;
|
|||
import android.app.AlertDialog;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.graphics.drawable.LayerDrawable;
|
||||
import android.support.v4.view.MenuItemCompat;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
|
@ -35,7 +33,7 @@ import android.content.IntentFilter;
|
|||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.drawable.LayerDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
@ -44,7 +42,6 @@ import android.os.Handler;
|
|||
import android.os.StrictMode;
|
||||
import android.provider.MediaStore;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.customtabs.CustomTabsIntent;
|
||||
import android.support.design.widget.AppBarLayout;
|
||||
import android.support.design.widget.NavigationView;
|
||||
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.ContextMenuWebView;
|
||||
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.DiasporaUrlHelper;
|
||||
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 org.json.JSONException;
|
||||
|
@ -188,14 +184,15 @@ public class MainActivity extends AppCompatActivity
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
Log.d(App.TAG, "onCreate()");
|
||||
AppLog.v(this, "onCreate()");
|
||||
|
||||
// Bind UI
|
||||
setContentView(R.layout.main__activity);
|
||||
|
||||
if ((app = (App) getApplication()) == null) Log.e(App.TAG, "App is null!");
|
||||
if ((appSettings = app.getSettings()) == null) Log.e(App.TAG, "AppSettings is null!");
|
||||
if ((podUserProfile = app.getPodUserProfile()) == null) Log.e(App.TAG, "PodUserProfile is null!");
|
||||
if ((app = (App) getApplication()) == null) AppLog.e(this, "App is null!");
|
||||
if ((appSettings = app.getSettings()) == null) AppLog.e(this, "AppSettings is null!");
|
||||
if ((podUserProfile = app.getPodUserProfile()) == null)
|
||||
AppLog.e(this, "PodUserProfile is null!");
|
||||
podUserProfile.setCallbackHandler(uiHandler);
|
||||
podUserProfile.setListener(this);
|
||||
urls = new DiasporaUrlHelper(appSettings);
|
||||
|
@ -205,7 +202,7 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
if (appSettings.isProxyEnabled()) {
|
||||
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();
|
||||
}
|
||||
} else if (appSettings.wasProxyEnabled()) {
|
||||
|
@ -227,27 +224,27 @@ public class MainActivity extends AppCompatActivity
|
|||
}
|
||||
|
||||
private void setupUI(Bundle savedInstanceState) {
|
||||
Log.i(App.TAG, "MainActivity.setupUI()");
|
||||
AppLog.i(this, "setupUI()");
|
||||
ButterKnife.bind(this);
|
||||
if (webviewPlaceholder.getChildCount() != 0) {
|
||||
Log.v(App.TAG, "remove child views from webViewPlaceholder");
|
||||
AppLog.v(this, "remove child views from webViewPlaceholder");
|
||||
webviewPlaceholder.removeAllViews();
|
||||
} else {
|
||||
Log.v(App.TAG, "webViewPlaceholder had no child views");
|
||||
AppLog.v(this, "webViewPlaceholder had no child views");
|
||||
}
|
||||
|
||||
boolean newWebView = (webView == null);
|
||||
if(newWebView) {
|
||||
Log.v(App.TAG, "WebView was null. Create new one.");
|
||||
if (newWebView) {
|
||||
AppLog.v(this, "WebView was null. Create new one.");
|
||||
View webviewHolder = getLayoutInflater().inflate(R.layout.webview, this.contentLayout, false);
|
||||
this.webView = (ContextMenuWebView) webviewHolder.findViewById(R.id.webView);
|
||||
((LinearLayout)webView.getParent()).removeView(webView);
|
||||
((LinearLayout) webView.getParent()).removeView(webView);
|
||||
setupWebView(savedInstanceState);
|
||||
} 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);
|
||||
// Setup toolbar
|
||||
setSupportActionBar(toolbarTop);
|
||||
|
@ -291,7 +288,7 @@ public class MainActivity extends AppCompatActivity
|
|||
String url = urls.getPodUrl();
|
||||
if (newWebView) {
|
||||
if (WebHelper.isOnline(MainActivity.this)) {
|
||||
Log.d(App.TAG, "setupUI: reload url");
|
||||
AppLog.v(this, "setupUI: reload url");
|
||||
webView.loadData("", "text/html", null);
|
||||
webView.loadUrlNew(url);
|
||||
} else {
|
||||
|
@ -300,23 +297,21 @@ public class MainActivity extends AppCompatActivity
|
|||
}
|
||||
|
||||
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();
|
||||
params.setScrollFlags(0); // clear all scroll flags
|
||||
}
|
||||
|
||||
Log.v(App.TAG, "UI successfully set up");
|
||||
AppLog.v(this, "UI successfully set up");
|
||||
handleIntent(getIntent());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(Configuration newConfig)
|
||||
{
|
||||
Log.i(App.TAG, "onConfigurationChanged()");
|
||||
if (webView != null)
|
||||
{
|
||||
public void onConfigurationChanged(Configuration newConfig) {
|
||||
AppLog.i(this, "onConfigurationChanged()");
|
||||
if (webView != null) {
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
@ -326,7 +321,7 @@ public class MainActivity extends AppCompatActivity
|
|||
setContentView(R.layout.main__activity);
|
||||
|
||||
// Reinitialize the UI
|
||||
Log.v(App.TAG, "Rebuild the UI");
|
||||
AppLog.v(this, "Rebuild the UI");
|
||||
setupUI(null);
|
||||
}
|
||||
|
||||
|
@ -343,7 +338,7 @@ public class MainActivity extends AppCompatActivity
|
|||
webSettings.setAppCacheEnabled(true);
|
||||
|
||||
if (savedInstanceState != null) {
|
||||
Log.v(App.TAG, "restore WebView state");
|
||||
AppLog.v(this, "restore WebView state");
|
||||
webView.restoreState(savedInstanceState);
|
||||
}
|
||||
|
||||
|
@ -397,22 +392,21 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
//For Android 4.1/4.2 only. DO NOT REMOVE!
|
||||
@SuppressWarnings("unused")
|
||||
protected void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture)
|
||||
{
|
||||
Log.v(App.TAG, "openFileChooser(ValCallback<Uri>, String, String");
|
||||
protected void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture) {
|
||||
AppLog.v(this, "openFileChooser(ValCallback<Uri>, String, String");
|
||||
imageUploadFilePathCallbackOld = uploadMsg;
|
||||
Intent intent = new Intent();
|
||||
intent.setType("image/*");
|
||||
intent.setAction(Intent.ACTION_GET_CONTENT);
|
||||
intent.putExtra("return-data", true);
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
if (hasWRITE_EXTERNAL_STORAGE != PackageManager.PERMISSION_GRANTED) {
|
||||
if (!shouldShowRequestPermissionRationale(Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
|
||||
|
@ -436,8 +430,9 @@ public class MainActivity extends AppCompatActivity
|
|||
}
|
||||
}
|
||||
|
||||
Log.d(App.TAG, "onOpenFileChooser");
|
||||
if (imageUploadFilePathCallbackNew != null) imageUploadFilePathCallbackNew.onReceiveValue(null);
|
||||
AppLog.v(this, "onOpenFileChooser");
|
||||
if (imageUploadFilePathCallbackNew != null)
|
||||
imageUploadFilePathCallbackNew.onReceiveValue(null);
|
||||
imageUploadFilePathCallbackNew = filePathCallback;
|
||||
|
||||
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
|
@ -448,7 +443,7 @@ public class MainActivity extends AppCompatActivity
|
|||
photoFile = Helpers.createImageFile();
|
||||
takePictureIntent.putExtra("PhotoPath", mCameraPhotoPath);
|
||||
} 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
|
||||
Snackbar.make(contentLayout, R.string.unable_to_load_image, Snackbar.LENGTH_LONG).show();
|
||||
return false;
|
||||
|
@ -480,7 +475,7 @@ public class MainActivity extends AppCompatActivity
|
|||
chooserIntent.putExtra(Intent.EXTRA_TITLE, "Image Chooser");
|
||||
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, intentArray);
|
||||
|
||||
Log.d(App.TAG,"startActivityForResult");
|
||||
AppLog.v(this, "startActivityForResult");
|
||||
startActivityForResult(chooserIntent, INPUT_FILE_REQUEST_CODE_NEW);
|
||||
return true;
|
||||
}
|
||||
|
@ -523,14 +518,14 @@ public class MainActivity extends AppCompatActivity
|
|||
if (!avatarUrl.equals("")) {
|
||||
//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)
|
||||
if(avatarUrl.startsWith("/assets/user/default")) {
|
||||
Log.v(App.TAG, "Avatar appears to be an asset. Display launcher icon instead (avatarUrl="+avatarUrl+")");
|
||||
if (avatarUrl.startsWith("/assets/user/default")) {
|
||||
AppLog.v(this, "Avatar appears to be an asset. Display launcher icon instead (avatarUrl=" + avatarUrl + ")");
|
||||
navheaderImage.setImageResource(R.drawable.ic_launcher);
|
||||
} else {
|
||||
// Try to load image
|
||||
if (!app.getAvatarImageLoader().loadToImageView(navheaderImage)) {
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
@ -552,7 +547,7 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
@OnClick(R.id.toolbar)
|
||||
public void onToolBarClicked(View view) {
|
||||
Log.i(App.TAG, "MainActivity.onToolBarClicked()");
|
||||
AppLog.i(this, "onToolBarClicked()");
|
||||
onNavigationItemSelected(navView.getMenu().findItem(R.id.nav_stream));
|
||||
}
|
||||
|
||||
|
@ -564,35 +559,35 @@ public class MainActivity extends AppCompatActivity
|
|||
}
|
||||
|
||||
private void handleIntent(Intent intent) {
|
||||
Log.i(App.TAG, "MainActivity.handleIntent()");
|
||||
AppLog.i(this, "handleIntent()");
|
||||
if (intent == null) {
|
||||
Log.v(App.TAG, "Intent was null");
|
||||
AppLog.v(this, "Intent was null");
|
||||
return;
|
||||
}
|
||||
|
||||
String action = intent.getAction();
|
||||
String type = intent.getType();
|
||||
String loadUrl = null;
|
||||
Log.v(App.TAG, "Action: "+action+" Type: "+type);
|
||||
AppLog.v(this, "Action: " + action + " Type: " + type);
|
||||
if (ACTION_OPEN_URL.equals(action)) {
|
||||
loadUrl = intent.getStringExtra(URL_MESSAGE);
|
||||
} else if (Intent.ACTION_VIEW.equals(action) && intent.getDataString() != null) {
|
||||
Uri data = intent.getData();
|
||||
if(data != null && data.toString().startsWith(CONTENT_HASHTAG)) {
|
||||
if (data != null && data.toString().startsWith(CONTENT_HASHTAG)) {
|
||||
handleHashtag(intent);
|
||||
return;
|
||||
} else {
|
||||
loadUrl = intent.getDataString();
|
||||
}
|
||||
} 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);
|
||||
Helpers.animateToActivity(MainActivity.this, PodSelectionActivity.class, true);
|
||||
} else if (ACTION_CLEAR_CACHE.equals(action)) {
|
||||
Log.v(App.TAG, "Clear WebView cache");
|
||||
AppLog.v(this, "Clear WebView cache");
|
||||
webView.clearCache(true);
|
||||
} else if (ACTION_RELOAD_ACTIVITY.equals(action)) {
|
||||
Log.v(App.TAG, "Recreate activity");
|
||||
AppLog.v(this, "Recreate activity");
|
||||
recreate();
|
||||
return;
|
||||
} else if (Intent.ACTION_SEND.equals(action) && type != null) {
|
||||
|
@ -621,61 +616,61 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
Log.d(App.TAG,"MainActivity.onActivityResult()");
|
||||
AppLog.v(this, "onActivityResult()");
|
||||
switch (requestCode) {
|
||||
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) {
|
||||
Log.e(App.TAG, "Callback is null: " + (imageUploadFilePathCallbackNew == null)
|
||||
AppLog.e(this, "Callback is null: " + (imageUploadFilePathCallbackNew == null)
|
||||
+ " resultCode: " + resultCode);
|
||||
return;
|
||||
}
|
||||
Uri[] results = null;
|
||||
if (data == 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)};
|
||||
} 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 {
|
||||
String dataString = data.getDataString();
|
||||
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)};
|
||||
}
|
||||
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 = null;
|
||||
return;
|
||||
}
|
||||
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) {
|
||||
Log.e(App.TAG, "Callback is null: " + (imageUploadFilePathCallbackOld == null)
|
||||
AppLog.e(this, "Callback is null: " + (imageUploadFilePathCallbackOld == null)
|
||||
+ " resultCode: " + resultCode);
|
||||
return;
|
||||
}
|
||||
Uri results = null;
|
||||
if (data == 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);
|
||||
} 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 {
|
||||
String dataString = data.getDataString();
|
||||
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);
|
||||
} 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 = null;
|
||||
return;
|
||||
|
@ -686,23 +681,23 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
Log.v(App.TAG, "MainActivity.onSaveInstanceState()");
|
||||
AppLog.v(this, "onSaveInstanceState()");
|
||||
super.onSaveInstanceState(outState);
|
||||
Log.v(App.TAG, "Save WebView state");
|
||||
AppLog.v(this, "Save WebView state");
|
||||
webView.saveState(outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRestoreInstanceState(@NonNull Bundle savedInstanceState) {
|
||||
Log.v(App.TAG, "MainActivity.onRestoreInstanceState()");
|
||||
AppLog.v(this, "onRestoreInstanceState()");
|
||||
super.onRestoreInstanceState(savedInstanceState);
|
||||
Log.v(App.TAG, "Restore state of WebView");
|
||||
AppLog.v(this, "Restore state of WebView");
|
||||
webView.restoreState(savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
Log.v(App.TAG, "MainActivity.onBackPressed()");
|
||||
AppLog.v(this, "onBackPressed()");
|
||||
if (navDrawer.isDrawerOpen(navView)) {
|
||||
navDrawer.closeDrawer(navView);
|
||||
return;
|
||||
|
@ -732,8 +727,8 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
Log.v(App.TAG, "MainActivity.onPause()");
|
||||
Log.v(App.TAG, "Unregister BroadcastReceivers");
|
||||
AppLog.v(this, "onPause()");
|
||||
AppLog.v(this, "Unregister BroadcastReceivers");
|
||||
LocalBroadcastManager.getInstance(this).unregisterReceiver(brSetTitle);
|
||||
LocalBroadcastManager.getInstance(this).unregisterReceiver(brOpenExternalLink);
|
||||
super.onPause();
|
||||
|
@ -741,16 +736,16 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
Log.v(App.TAG, "MainActivity.onResume()");
|
||||
AppLog.v(this, "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(brOpenExternalLink, new IntentFilter(ACTION_OPEN_EXTERNAL_URL));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
Log.v(App.TAG, "MainActivity.onCreateOptionsMenu()");
|
||||
AppLog.v(this, "onCreateOptionsMenu()");
|
||||
getMenuInflater().inflate(R.menu.main__menu_top, menu);
|
||||
return true;
|
||||
}
|
||||
|
@ -773,7 +768,7 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
Log.i(App.TAG, "MainActivity.onOptionsItemSelected()");
|
||||
AppLog.i(this, "onOptionsItemSelected()");
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_notifications: {
|
||||
if (WebHelper.isOnline(MainActivity.this)) {
|
||||
|
@ -862,7 +857,7 @@ public class MainActivity extends AppCompatActivity
|
|||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int which) {
|
||||
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();
|
||||
} else {
|
||||
webView.loadUrl(which == DialogInterface.BUTTON_NEGATIVE ? urls.getSearchPeopleUrl(query) : urls.getSearchTagsUrl(query));
|
||||
|
@ -908,7 +903,7 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
@SuppressWarnings("ResultOfMethodCallIgnored")
|
||||
private boolean makeScreenshotOfWebView(boolean hasToShareScreenshot) {
|
||||
Log.i(App.TAG, "MainActivity.makeScreenshotOfWebView()");
|
||||
AppLog.i(this, "makeScreenshotOfWebView()");
|
||||
if (android.os.Build.VERSION.SDK_INT >= 23) {
|
||||
int hasWRITE_EXTERNAL_STORAGE = checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
||||
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));
|
||||
if (!fileSaveDirectory.exists()) {
|
||||
if(!fileSaveDirectory.mkdirs()) {
|
||||
Log.w(App.TAG, "Could not mkdir "+fileSaveDirectory.getAbsolutePath());
|
||||
if (!fileSaveDirectory.mkdirs()) {
|
||||
AppLog.w(this, "Could not mkdir " + fileSaveDirectory.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -990,32 +985,32 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
@Override
|
||||
public void onUserProfileNameChanged(String name) {
|
||||
Log.i(App.TAG, "MainActivity.onUserProfileNameChanged()");
|
||||
AppLog.i(this, "onUserProfileNameChanged()");
|
||||
navheaderTitle.setText(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserProfileAvatarChanged(String avatarUrl) {
|
||||
Log.i(App.TAG, "MainActivity.onUserProfileAvatarChanged()");
|
||||
AppLog.i(this, "onUserProfileAvatarChanged()");
|
||||
app.getAvatarImageLoader().startImageDownload(navheaderImage, avatarUrl);
|
||||
}
|
||||
|
||||
private void handleHashtag(Intent intent) {
|
||||
Log.v(App.TAG, "handleHashtag()");
|
||||
AppLog.v(this, "handleHashtag()");
|
||||
try {
|
||||
setSharedTexts(null, intent.getData().toString().split("/")[3]);
|
||||
} catch (Exception e) {
|
||||
Log.e(App.TAG, e.toString());
|
||||
AppLog.e(this, e.toString());
|
||||
}
|
||||
webView.loadUrlNew(urls.getNewPostUrl());
|
||||
}
|
||||
|
||||
private void handleSendText(Intent intent) {
|
||||
Log.v(App.TAG, "handleSendText()");
|
||||
AppLog.v(this, "handleSendText()");
|
||||
try {
|
||||
setSharedTexts(null, intent.getStringExtra(Intent.EXTRA_TEXT));
|
||||
} catch (Exception e) {
|
||||
Log.e(App.TAG, e.toString());
|
||||
AppLog.e(this, e.toString());
|
||||
}
|
||||
webView.loadUrlNew(urls.getBlankUrl());
|
||||
webView.loadUrlNew(urls.getNewPostUrl());
|
||||
|
@ -1027,11 +1022,11 @@ public class MainActivity extends AppCompatActivity
|
|||
* @param intent intent
|
||||
*/
|
||||
private void handleSendSubject(Intent intent) {
|
||||
Log.v(App.TAG, "handleSendSubject()");
|
||||
AppLog.v(this, "handleSendSubject()");
|
||||
try {
|
||||
setSharedTexts(intent.getStringExtra(Intent.EXTRA_SUBJECT), intent.getStringExtra(Intent.EXTRA_TEXT));
|
||||
} catch (Exception e) {
|
||||
Log.e(App.TAG, e.toString());
|
||||
AppLog.e(this, e.toString());
|
||||
}
|
||||
webView.loadUrlNew(urls.getBlankUrl()); //TODO: Necessary?
|
||||
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.
|
||||
* Depending on whether the user has the setting isAppendSharedViaApp set, a reference to
|
||||
* the app will be added at the bottom
|
||||
*
|
||||
* @param sharedSubject post subject or null
|
||||
* @param sharedBody post text
|
||||
* @param sharedBody post text
|
||||
*/
|
||||
private void setSharedTexts(String sharedSubject, String sharedBody) {
|
||||
Log.i(App.TAG, "MainActivity.setSharedTexts()");
|
||||
AppLog.i(this, "setSharedTexts()");
|
||||
String body = WebHelper.replaceUrlWithMarkdown(sharedBody);
|
||||
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);
|
||||
}
|
||||
final String escapedBody = WebHelper.escapeHtmlText(body);
|
||||
if(sharedSubject != null) {
|
||||
Log.v(App.TAG, "Append subject to shared text");
|
||||
if (sharedSubject != null) {
|
||||
AppLog.v(this, "Append subject to shared text");
|
||||
String escapedSubject = WebHelper.escapeHtmlText(WebHelper.replaceUrlWithMarkdown(sharedSubject));
|
||||
textToBeShared = "**" + escapedSubject + "** " + escapedBody;
|
||||
} else {
|
||||
Log.v(App.TAG, "Set shared text; Subject: \""+sharedSubject+"\" Body: \""+sharedBody+"\"");
|
||||
AppLog.v(this, "Set shared text; Subject: \"" + sharedSubject + "\" Body: \"" + sharedBody + "\"");
|
||||
textToBeShared = escapedBody;
|
||||
}
|
||||
|
||||
|
@ -1067,13 +1063,13 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
//TODO: Implement?
|
||||
private void handleSendImage(Intent intent) {
|
||||
Log.i(App.TAG, "MainActivity.handleSendImage()");
|
||||
AppLog.i(this, "handleSendImage()");
|
||||
final Uri imageUri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
|
||||
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
|
||||
} 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();
|
||||
}
|
||||
|
@ -1081,7 +1077,7 @@ public class MainActivity extends AppCompatActivity
|
|||
// TODO: Move from Javascript interface
|
||||
@Override
|
||||
public void onNotificationCountChanged(int notificationCount) {
|
||||
Log.i(App.TAG, "MainActivity.onNotificationCountChanged()");
|
||||
AppLog.i(this, "onNotificationCountChanged()");
|
||||
// Count saved in PodUserProfile
|
||||
invalidateOptionsMenu();
|
||||
|
||||
|
@ -1094,7 +1090,7 @@ public class MainActivity extends AppCompatActivity
|
|||
// TODO: Move from Javascript interface
|
||||
@Override
|
||||
public void onUnreadMessageCountChanged(int unreadMessageCount) {
|
||||
Log.i(App.TAG, "MainActivity.onUnreadMessageCountChanged()");
|
||||
AppLog.i(this, "onUnreadMessageCountChanged()");
|
||||
// Count saved in PodUserProfile
|
||||
invalidateOptionsMenu();
|
||||
if (unreadMessageCount > 0 && !snackbarNewNotification.isShown()
|
||||
|
@ -1106,12 +1102,12 @@ public class MainActivity extends AppCompatActivity
|
|||
private class JavaScriptInterface {
|
||||
@JavascriptInterface
|
||||
public void setUserProfile(final String webMessage) throws JSONException {
|
||||
Log.i(App.TAG, "MainActivity.JavaScriptInterface.setUserProfile()");
|
||||
AppLog.spam(this, "JavaScriptInterface.setUserProfile()");
|
||||
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);
|
||||
} 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")
|
||||
@Override
|
||||
public boolean onNavigationItemSelected(MenuItem item) {
|
||||
Log.i(App.TAG, "MainActivity.onNavigationItemsSelected()");
|
||||
AppLog.v(this, "onNavigationItemsSelected()");
|
||||
// Handle navigation view item clicks here.
|
||||
switch (item.getItemId()) {
|
||||
case R.id.nav_stream: {
|
||||
|
@ -1237,10 +1233,10 @@ public class MainActivity extends AppCompatActivity
|
|||
switch (requestCode) {
|
||||
case REQUEST_CODE__ACCESS_EXTERNAL_STORAGE:
|
||||
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();
|
||||
} 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();
|
||||
}
|
||||
return;
|
||||
|
@ -1261,35 +1257,35 @@ public class MainActivity extends AppCompatActivity
|
|||
* @throws IllegalArgumentException if arguments do not fit specifications above
|
||||
*/
|
||||
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) {
|
||||
Log.i(App.TAG, "Set proxy to "+host+":"+port);
|
||||
AppLog.v(this, "Set proxy to " + host + ":" + port);
|
||||
//Temporary change thread policy
|
||||
Log.v(App.TAG, "Set temporary ThreadPolicy");
|
||||
AppLog.v(this, "Set temporary ThreadPolicy");
|
||||
StrictMode.ThreadPolicy old = StrictMode.getThreadPolicy();
|
||||
StrictMode.ThreadPolicy tmp = new StrictMode.ThreadPolicy.Builder().permitAll().build();
|
||||
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
|
||||
try {
|
||||
//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);
|
||||
} 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.setProxyWasEnabled(true);
|
||||
|
||||
Log.v(App.TAG, "Reset old ThreadPolicy");
|
||||
AppLog.v(this, "Reset old ThreadPolicy");
|
||||
StrictMode.setThreadPolicy(old);
|
||||
Log.i(App.TAG, "Success! Reload WebView");
|
||||
AppLog.v(this, "Success! Reload WebView");
|
||||
webView.reload();
|
||||
return true;
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
|
@ -1299,30 +1295,30 @@ public class MainActivity extends AppCompatActivity
|
|||
}
|
||||
|
||||
private void resetProxy() {
|
||||
Log.i(App.TAG, "MainActivity.resetProxy()");
|
||||
Log.v(App.TAG, "write changes to appSettings");
|
||||
AppLog.i(this, "resetProxy()");
|
||||
AppLog.v(this, "write changes to appSettings");
|
||||
appSettings.setProxyEnabled(false);
|
||||
appSettings.setProxyWasEnabled(false);
|
||||
|
||||
//Temporary change thread policy
|
||||
Log.v(App.TAG, "Set temporary ThreadPolicy");
|
||||
AppLog.v(this, "Set temporary ThreadPolicy");
|
||||
StrictMode.ThreadPolicy old = StrictMode.getThreadPolicy();
|
||||
StrictMode.ThreadPolicy tmp = new StrictMode.ThreadPolicy.Builder().permitAll().build();
|
||||
StrictMode.setThreadPolicy(tmp);
|
||||
|
||||
Log.v(App.TAG, "clear NetCipher proxy");
|
||||
AppLog.v(this, "clear NetCipher proxy");
|
||||
NetCipher.clearProxy();
|
||||
try {
|
||||
Log.v(App.TAG, "clear WebKit proxy");
|
||||
AppLog.v(this, "clear WebKit proxy");
|
||||
WebkitProxy.resetProxy(MainActivity.class.getName(), this);
|
||||
} 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);
|
||||
|
||||
//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);
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(this, 12374, restartActivity, PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
AlarmManager mgr = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
|
||||
|
|
|
@ -34,6 +34,8 @@ import android.view.MenuItem;
|
|||
|
||||
import com.github.dfa.diaspora_android.App;
|
||||
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
|
||||
|
@ -45,14 +47,13 @@ public class SettingsActivity extends AppCompatActivity {
|
|||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ActionBar toolbar = getSupportActionBar();
|
||||
if(toolbar != null)
|
||||
if (toolbar != null)
|
||||
toolbar.setDisplayHomeAsUpEnabled(true);
|
||||
getFragmentManager().beginTransaction().replace(android.R.id.content, new SettingsFragment()).commit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem menuItem)
|
||||
{
|
||||
public boolean onOptionsItemSelected(MenuItem menuItem) {
|
||||
switch (menuItem.getItemId()) {
|
||||
case android.R.id.home:
|
||||
onBackPressed();
|
||||
|
@ -93,7 +94,7 @@ public class SettingsActivity extends AppCompatActivity {
|
|||
@Override
|
||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String 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__load_images)) ||
|
||||
key.equals(getString(R.string.pref_key__intellihide_toolbars)) ||
|
||||
|
@ -157,6 +158,7 @@ public class SettingsActivity extends AppCompatActivity {
|
|||
.show();
|
||||
return true;
|
||||
}
|
||||
|
||||
default: {
|
||||
intent = null;
|
||||
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
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
|
|
|
@ -260,6 +260,14 @@ public class AppSettings {
|
|||
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() {
|
||||
return getBoolean(prefApp, R.string.pref_key__visibility_nav__exit, false);
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
package com.github.dfa.diaspora_android.data;
|
||||
|
||||
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.App;
|
||||
|
@ -126,7 +128,7 @@ public class PodUserProfile {
|
|||
|
||||
isWebUserProfileLoaded = true;
|
||||
} catch (JSONException e) {
|
||||
Log.d(App.TAG, e.getMessage());
|
||||
AppLog.d(this, e.getMessage());
|
||||
isWebUserProfileLoaded = false;
|
||||
}
|
||||
lastLoaded = System.currentTimeMillis();
|
||||
|
|
|
@ -13,6 +13,7 @@ import com.github.dfa.diaspora_android.App;
|
|||
import com.github.dfa.diaspora_android.R;
|
||||
import com.github.dfa.diaspora_android.activity.MainActivity;
|
||||
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.CustomTabActivityHelper;
|
||||
import com.github.dfa.diaspora_android.util.Helpers;
|
||||
|
@ -33,14 +34,14 @@ public class OpenExternalLinkReceiver extends BroadcastReceiver {
|
|||
public void onReceive(Context c, Intent receiveIntent) {
|
||||
AppSettings settings = new AppSettings(c);
|
||||
|
||||
Log.v(App.TAG, "OpenExternalLinkReceiver.onReceive(): url");
|
||||
AppLog.v(this, "OpenExternalLinkReceiver.onReceive(): url");
|
||||
|
||||
Uri url = null;
|
||||
try {
|
||||
String sUrl = receiveIntent.getStringExtra(MainActivity.EXTRA_URL);
|
||||
url = Uri.parse(sUrl);
|
||||
} 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@ import com.github.dfa.diaspora_android.App;
|
|||
import com.github.dfa.diaspora_android.R;
|
||||
import com.github.dfa.diaspora_android.activity.MainActivity;
|
||||
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.Log;
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
private DiasporaUrlHelper urls;
|
||||
private AppSettings appSettings;
|
||||
private AppSettings appSettings;
|
||||
private App app;
|
||||
private TitleCallback callback;
|
||||
|
||||
|
@ -33,7 +33,7 @@ public class UpdateTitleReceiver extends BroadcastReceiver {
|
|||
String url = intent.getStringExtra(MainActivity.EXTRA_URL);
|
||||
if (url != null && url.startsWith(urls.getPodUrl())) {
|
||||
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)) {
|
||||
setTitle(R.string.nav_stream);
|
||||
} else if (subUrl.startsWith(DiasporaUrlHelper.SUBURL_POSTS)) {
|
||||
|
@ -56,11 +56,11 @@ public class UpdateTitleReceiver extends BroadcastReceiver {
|
|||
setTitle(R.string.nav_mentions);
|
||||
} else if (subUrl.startsWith(DiasporaUrlHelper.SUBURL_PUBLIC)) {
|
||||
setTitle(R.string.public_);
|
||||
} else if (urls.isAspectUrl(url)){
|
||||
} else if (urls.isAspectUrl(url)) {
|
||||
setTitle(urls.getAspectNameFromUrl(url, app));
|
||||
}
|
||||
} 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 {
|
||||
void setTitle(int Rid);
|
||||
|
||||
void setTitle(String title);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,9 +23,8 @@ import android.content.Intent;
|
|||
import android.os.AsyncTask;
|
||||
import android.os.IBinder;
|
||||
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.JSONObject;
|
||||
|
@ -43,7 +42,6 @@ import info.guardianproject.netcipher.NetCipher;
|
|||
|
||||
public class GetPodsService extends Service {
|
||||
public static final String MESSAGE_PODS_RECEIVED = "com.github.dfa.diaspora.podsreceived";
|
||||
private static final String TAG = App.TAG;
|
||||
|
||||
public GetPodsService() {
|
||||
}
|
||||
|
@ -92,7 +90,7 @@ public class GetPodsService extends Service {
|
|||
|
||||
connection.disconnect();
|
||||
} else {
|
||||
Log.e(TAG, "Failed to download list of pods");
|
||||
AppLog.e(this, "Failed to download list of pods");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
//TODO handle json buggy feed
|
||||
|
@ -102,7 +100,7 @@ public class GetPodsService extends Service {
|
|||
try {
|
||||
JSONObject jsonObjectAll = new JSONObject(builder.toString());
|
||||
JSONArray jsonArrayAll = jsonObjectAll.getJSONArray("pods");
|
||||
Log.d(TAG, "Number of entries " + jsonArrayAll.length());
|
||||
AppLog.d(this, "Number of entries " + jsonArrayAll.length());
|
||||
list = new ArrayList<>();
|
||||
for (int i = 0; i < jsonArrayAll.length(); i++) {
|
||||
JSONObject jo = jsonArrayAll.getJSONObject(i);
|
||||
|
|
|
@ -22,6 +22,8 @@ import android.graphics.Bitmap;
|
|||
import android.graphics.BitmapFactory;
|
||||
import android.os.AsyncTask;
|
||||
import android.support.annotation.Nullable;
|
||||
|
||||
import com.github.dfa.diaspora_android.util.AppLog;
|
||||
import com.github.dfa.diaspora_android.util.Log;
|
||||
import android.widget.ImageView;
|
||||
|
||||
|
@ -78,7 +80,7 @@ public class ImageDownloadTask extends AsyncTask<String, Void, Bitmap> {
|
|||
connection.disconnect();
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.e(App.TAG, e.getMessage());
|
||||
AppLog.e(this, e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
if (out != null) {
|
||||
|
|
|
@ -20,6 +20,8 @@ package com.github.dfa.diaspora_android.task;
|
|||
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
|
||||
import com.github.dfa.diaspora_android.util.AppLog;
|
||||
import com.github.dfa.diaspora_android.util.Log;
|
||||
import android.webkit.CookieManager;
|
||||
|
||||
|
@ -60,7 +62,7 @@ public class ProfileFetchTask extends AsyncTask<Void, Void, Void> {
|
|||
String extractedProfileData = null;
|
||||
final CookieManager cookieManager = app.getCookieManager();
|
||||
String cookies = cookieManager.getCookie(urls.getPodUrl());
|
||||
Log.d(App.TAG, cookies);
|
||||
AppLog.d(this, cookies);
|
||||
|
||||
HttpsURLConnection connection;
|
||||
InputStream inStream;
|
||||
|
@ -101,7 +103,7 @@ public class ProfileFetchTask extends AsyncTask<Void, Void, Void> {
|
|||
if (extractedProfileData != null) {
|
||||
PodUserProfile profile = new PodUserProfile(app);
|
||||
profile.parseJson(extractedProfileData);
|
||||
Log.d(App.TAG, "Extracted new_messages (service):" + profile.getUnreadMessagesCount());
|
||||
AppLog.d(this, "Extracted new_messages (service):" + profile.getUnreadMessagesCount());
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -20,6 +20,8 @@ package com.github.dfa.diaspora_android.task;
|
|||
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
|
||||
import com.github.dfa.diaspora_android.util.AppLog;
|
||||
import com.github.dfa.diaspora_android.util.Log;
|
||||
import android.webkit.CookieManager;
|
||||
|
||||
|
@ -77,7 +79,7 @@ public class StatisticsFetchTask extends AsyncTask<Void, Void, Void> {
|
|||
BufferedReader br = new BufferedReader(new InputStreamReader(inStream));
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
Log.d(App.TAG, "STATS: "+line);
|
||||
AppLog.d(this, "STATS: "+line);
|
||||
}
|
||||
|
||||
try{
|
||||
|
|
|
@ -52,13 +52,13 @@ public class CustomWebViewClient extends WebViewClient {
|
|||
|
||||
final CookieManager cookieManager = app.getCookieManager();
|
||||
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) {
|
||||
cookieManager.setCookie(url, cookies);
|
||||
cookieManager.setCookie("https://" + app.getSettings().getPodDomain(), cookies);
|
||||
//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();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -10,6 +10,8 @@ import android.support.customtabs.CustomTabsService;
|
|||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.github.dfa.diaspora_android.util.AppLog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -107,7 +109,7 @@ public class CustomTabsHelper {
|
|||
return true;
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
Log.e(TAG, "Runtime exception while getting specialized handlers");
|
||||
AppLog.e(TAG, "Runtime exception while getting specialized handlers");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ public class Helpers {
|
|||
// Create an image file name
|
||||
String timeStamp = new SimpleDateFormat("dd-MM-yy_HH-mm", Locale.getDefault()).format(new Date());
|
||||
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(
|
||||
Environment.DIRECTORY_PICTURES);
|
||||
return new File(
|
||||
|
@ -116,15 +116,15 @@ public class Helpers {
|
|||
public static void printBundle(Bundle savedInstanceState, String k) {
|
||||
if (savedInstanceState != null) {
|
||||
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);
|
||||
if (bun != null) {
|
||||
if (bun instanceof Bundle) {
|
||||
printBundle((Bundle) bun, k + "." + key);
|
||||
} 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 {
|
||||
Log.d("SAVED", "Key: " + k + "." + key + ": " + bun.toString());
|
||||
AppLog.d("SAVED", "Key: " + k + "." + key + ": " + bun.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<!-- Key Names (Untranslatable) -->
|
||||
<!-- Navigiation Slider -->
|
||||
<!-- PodProfile -->
|
||||
<!-- More -->
|
||||
<!-- Category Titles -->
|
||||
<!-- Visuals -->
|
||||
<!-- Navigiation Slider -->
|
||||
|
@ -11,6 +12,8 @@
|
|||
<!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash -->
|
||||
<!-- Load images -->
|
||||
<!-- Proxy -->
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<!-- More -->
|
||||
<!-- Recently added - Please move to right section-->
|
||||
</resources>
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
<string name="fragment_debug__section_device">Gerät</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_spam">Debug-Protokoll (Verbose)</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__android_version">Android Version: %1$s</string>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<!-- Key Names (Untranslatable) -->
|
||||
<!-- Navigiation Slider -->
|
||||
<!-- PodProfile -->
|
||||
<!-- More -->
|
||||
<!-- Category Titles -->
|
||||
<string name="pref_cat__visuals">Erscheinungsbild</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_title__proxy_host">Host</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 -->
|
||||
<string name="pref_title__personal_settings">Persönliche Einstellungen</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__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…\")</string>
|
||||
<!-- More -->
|
||||
<!-- Recently added - Please move to right section-->
|
||||
</resources>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<!-- Key Names (Untranslatable) -->
|
||||
<!-- Navigiation Slider -->
|
||||
<!-- PodProfile -->
|
||||
<!-- More -->
|
||||
<!-- Category Titles -->
|
||||
<!-- Visuals -->
|
||||
<!-- Navigiation Slider -->
|
||||
|
@ -11,6 +12,8 @@
|
|||
<!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash -->
|
||||
<!-- Load images -->
|
||||
<!-- Proxy -->
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<!-- More -->
|
||||
<!-- Recently added - Please move to right section-->
|
||||
</resources>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<!-- Key Names (Untranslatable) -->
|
||||
<!-- Navigiation Slider -->
|
||||
<!-- PodProfile -->
|
||||
<!-- More -->
|
||||
<!-- Category Titles -->
|
||||
<string name="pref_cat__visuals">Aspecto</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_title__proxy_host">Anfitrión</string>
|
||||
<string name="pref_title__proxy_port">Puerto</string>
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<string name="pref_title__personal_settings">Configuración personal</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__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…\") a los textos compartidos</string>
|
||||
<!-- More -->
|
||||
<!-- Recently added - Please move to right section-->
|
||||
</resources>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<!-- Key Names (Untranslatable) -->
|
||||
<!-- Navigiation Slider -->
|
||||
<!-- PodProfile -->
|
||||
<!-- More -->
|
||||
<!-- Category Titles -->
|
||||
<string name="pref_cat__visuals">Apparence</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_title__proxy_host">Hôte</string>
|
||||
<string name="pref_title__proxy_port">Port</string>
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<string name="pref_title__personal_settings">Paramètres personnels</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__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 …\") aux textes partagés</string>
|
||||
<!-- More -->
|
||||
<!-- Recently added - Please move to right section-->
|
||||
</resources>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<!-- Key Names (Untranslatable) -->
|
||||
<!-- Navigiation Slider -->
|
||||
<!-- PodProfile -->
|
||||
<!-- More -->
|
||||
<!-- Category Titles -->
|
||||
<!-- Visuals -->
|
||||
<!-- Navigiation Slider -->
|
||||
|
@ -11,6 +12,8 @@
|
|||
<!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash -->
|
||||
<!-- Load images -->
|
||||
<!-- Proxy -->
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<!-- More -->
|
||||
<!-- Recently added - Please move to right section-->
|
||||
</resources>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<!-- Key Names (Untranslatable) -->
|
||||
<!-- Navigiation Slider -->
|
||||
<!-- PodProfile -->
|
||||
<!-- More -->
|
||||
<!-- Category Titles -->
|
||||
<!-- Visuals -->
|
||||
<!-- Navigiation Slider -->
|
||||
|
@ -11,6 +12,8 @@
|
|||
<!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash -->
|
||||
<!-- Load images -->
|
||||
<!-- Proxy -->
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<!-- More -->
|
||||
<!-- Recently added - Please move to right section-->
|
||||
</resources>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<!-- Key Names (Untranslatable) -->
|
||||
<!-- Navigiation Slider -->
|
||||
<!-- PodProfile -->
|
||||
<!-- More -->
|
||||
<!-- Category Titles -->
|
||||
<string name="pref_cat__visuals">Aspetto</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_title__proxy_host">Host</string>
|
||||
<string name="pref_title__proxy_port">Porta</string>
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<string name="pref_title__personal_settings">Impostazioni personali</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__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…\") nei testi condivisi</string>
|
||||
<!-- More -->
|
||||
<!-- Recently added - Please move to right section-->
|
||||
</resources>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<!-- Key Names (Untranslatable) -->
|
||||
<!-- Navigiation Slider -->
|
||||
<!-- PodProfile -->
|
||||
<!-- More -->
|
||||
<!-- Category Titles -->
|
||||
<string name="pref_cat__visuals">外観</string>
|
||||
<string name="pref_cat__network">ネットワーク</string>
|
||||
|
@ -24,6 +25,7 @@
|
|||
<string name="pref_desc__proxy_enabled">Diaspora の通信をプロキシして、ファイアウォールに回避します。\n再起動が必要になることがあります</string>
|
||||
<string name="pref_title__proxy_host">ホスト</string>
|
||||
<string name="pref_title__proxy_port">ポート</string>
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<string name="pref_title__personal_settings">個人用設定</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__append_shared_via_app">共有方法の通知を追加</string>
|
||||
<string name="pref_desc__append_shared_via_app">共有テキストに、このアプリへの参照 (\"…で共有\") を追加します</string>
|
||||
<!-- More -->
|
||||
<!-- Recently added - Please move to right section-->
|
||||
</resources>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<!-- Key Names (Untranslatable) -->
|
||||
<!-- Navigiation Slider -->
|
||||
<!-- PodProfile -->
|
||||
<!-- More -->
|
||||
<!-- Category Titles -->
|
||||
<!-- Visuals -->
|
||||
<!-- Navigiation Slider -->
|
||||
|
@ -11,6 +12,8 @@
|
|||
<!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash -->
|
||||
<!-- Load images -->
|
||||
<!-- Proxy -->
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<!-- More -->
|
||||
<!-- Recently added - Please move to right section-->
|
||||
</resources>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<!-- Key Names (Untranslatable) -->
|
||||
<!-- Navigiation Slider -->
|
||||
<!-- PodProfile -->
|
||||
<!-- More -->
|
||||
<!-- Category Titles -->
|
||||
<string name="pref_cat__visuals">കാഴ്ച്ച</string>
|
||||
<string name="pref_cat__network">ശൃങ്കല</string>
|
||||
|
@ -24,6 +25,7 @@
|
|||
<string name="pref_desc__proxy_enabled">ഫയർവാളുകളെ മറികടക്കാൻ ഡയസ്പോറ ട്രാഫിക് പ്രോക്സി ചെയ്യൂ.\nപുനരാരംഭിക്കേണ്ടി വന്നേക്കാം</string>
|
||||
<string name="pref_title__proxy_host">ആഥിതേയൻ</string>
|
||||
<string name="pref_title__proxy_port">പോർട്ട്</string>
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<string name="pref_title__personal_settings">സ്വകാര്യ സജ്ജീകരണങ്ങൾ</string>
|
||||
<string name="pref_title__manage_contacts">ബന്ധങ്ങൾ</string>
|
||||
|
@ -39,5 +41,6 @@
|
|||
<string name="pref_title__intellihide_toolbars">ടൂൾബാറുകൾ ഇന്റലിഹൈഡ് ചെയ്യുക</string>
|
||||
<string name="pref_title__append_shared_via_app">അറിയിപ്പാൽ പങ്കുവച്ചത് എന്ന് കൂട്ടിച്ചേർക്കുക</string>
|
||||
<string name="pref_desc__append_shared_via_app">പങ്കുവയ്ക്കുന്ന വാചകങ്ങളിൽ ഈ പ്രയോഗത്തിന്റെ അവലംബം(\"…പങ്കുവച്ചത്\") എന്ന് കൂട്ടിച്ചേർക്കുക</string>
|
||||
<!-- More -->
|
||||
<!-- Recently added - Please move to right section-->
|
||||
</resources>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<!-- Key Names (Untranslatable) -->
|
||||
<!-- Navigiation Slider -->
|
||||
<!-- PodProfile -->
|
||||
<!-- More -->
|
||||
<!-- Category Titles -->
|
||||
<string name="pref_cat__visuals">Vormgeving</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_title__proxy_host">Host</string>
|
||||
<string name="pref_title__proxy_port">Poort</string>
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<string name="pref_title__personal_settings">Persoonlijke instellingen</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__append_shared_via_app">Gedeeld-via-aankondiging toevoegen</string>
|
||||
<string name="pref_desc__append_shared_via_app">Een verwijzing naar dit app (\"gedeeld door…\") toevoegen aan gedeelde teksten</string>
|
||||
<!-- More -->
|
||||
<!-- Recently added - Please move to right section-->
|
||||
</resources>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<!-- Key Names (Untranslatable) -->
|
||||
<!-- Navigiation Slider -->
|
||||
<!-- PodProfile -->
|
||||
<!-- More -->
|
||||
<!-- Category Titles -->
|
||||
<!-- Visuals -->
|
||||
<!-- Navigiation Slider -->
|
||||
|
@ -11,6 +12,8 @@
|
|||
<!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash -->
|
||||
<!-- Load images -->
|
||||
<!-- Proxy -->
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<!-- More -->
|
||||
<!-- Recently added - Please move to right section-->
|
||||
</resources>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<!-- Key Names (Untranslatable) -->
|
||||
<!-- Navigiation Slider -->
|
||||
<!-- PodProfile -->
|
||||
<!-- More -->
|
||||
<!-- Category Titles -->
|
||||
<string name="pref_cat__visuals">Wygląd</string>
|
||||
<string name="pref_cat__network">Sieć</string>
|
||||
|
@ -17,6 +18,7 @@
|
|||
<string name="pref_title__load_images">Załaduj obrazy</string>
|
||||
<!-- Proxy -->
|
||||
<string name="pref_title__proxy_enabled">Włącz serwer Proxy</string>
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<string name="pref_title__personal_settings">Ustawienia osobiste</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_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>
|
||||
<!-- More -->
|
||||
<!-- Recently added - Please move to right section-->
|
||||
</resources>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<!-- Key Names (Untranslatable) -->
|
||||
<!-- Navigiation Slider -->
|
||||
<!-- PodProfile -->
|
||||
<!-- More -->
|
||||
<!-- Category Titles -->
|
||||
<string name="pref_cat__visuals">Aparência</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_title__proxy_host">Servidor</string>
|
||||
<string name="pref_title__proxy_port">Porta</string>
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<string name="pref_title__personal_settings">Configurações pessoais</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__append_shared_via_app">Acrescentar compartilhado-por-aviso</string>
|
||||
<string name="pref_desc__append_shared_via_app">Acrescentar uma referência (\"compartilhado por…\") a este app para textos compartilhados</string>
|
||||
<!-- More -->
|
||||
<!-- Recently added - Please move to right section-->
|
||||
</resources>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<!-- Key Names (Untranslatable) -->
|
||||
<!-- Navigiation Slider -->
|
||||
<!-- PodProfile -->
|
||||
<!-- More -->
|
||||
<!-- Category Titles -->
|
||||
<!-- Visuals -->
|
||||
<!-- Navigiation Slider -->
|
||||
|
@ -11,6 +12,8 @@
|
|||
<!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash -->
|
||||
<!-- Load images -->
|
||||
<!-- Proxy -->
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<!-- More -->
|
||||
<!-- Recently added - Please move to right section-->
|
||||
</resources>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<!-- Key Names (Untranslatable) -->
|
||||
<!-- Navigiation Slider -->
|
||||
<!-- PodProfile -->
|
||||
<!-- More -->
|
||||
<!-- Category Titles -->
|
||||
<string name="pref_cat__visuals">Внешний вид</string>
|
||||
<string name="pref_cat__network">Сеть</string>
|
||||
|
@ -24,6 +25,7 @@
|
|||
<string name="pref_desc__proxy_enabled">Перенаправить трафик Диаспоры в обход брандмауэров.\nМожет потребовать перезапуска</string>
|
||||
<string name="pref_title__proxy_host">Хост</string>
|
||||
<string name="pref_title__proxy_port">Порт</string>
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<string name="pref_title__personal_settings">Личные настройки</string>
|
||||
<string name="pref_title__manage_contacts">Контакты</string>
|
||||
|
@ -39,5 +41,6 @@
|
|||
<string name="pref_title__intellihide_toolbars">Интеллектуальное скрытие панелей инструментов</string>
|
||||
<string name="pref_title__append_shared_via_app">Присоединять \"Опубликовано из\" к сообщению</string>
|
||||
<string name="pref_desc__append_shared_via_app">Присоединять ссылку на приложение (\"Опубликовано из…\") к размещенным записям</string>
|
||||
<!-- More -->
|
||||
<!-- Recently added - Please move to right section-->
|
||||
</resources>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<!-- Key Names (Untranslatable) -->
|
||||
<!-- Navigiation Slider -->
|
||||
<!-- PodProfile -->
|
||||
<!-- More -->
|
||||
<!-- Category Titles -->
|
||||
<!-- Visuals -->
|
||||
<!-- Navigiation Slider -->
|
||||
|
@ -11,6 +12,8 @@
|
|||
<!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash -->
|
||||
<!-- Load images -->
|
||||
<!-- Proxy -->
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<!-- More -->
|
||||
<!-- Recently added - Please move to right section-->
|
||||
</resources>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<!-- Key Names (Untranslatable) -->
|
||||
<!-- Navigiation Slider -->
|
||||
<!-- PodProfile -->
|
||||
<!-- More -->
|
||||
<!-- Category Titles -->
|
||||
<!-- Visuals -->
|
||||
<!-- Navigiation Slider -->
|
||||
|
@ -11,6 +12,8 @@
|
|||
<!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash -->
|
||||
<!-- Load images -->
|
||||
<!-- Proxy -->
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<!-- More -->
|
||||
<!-- Recently added - Please move to right section-->
|
||||
</resources>
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
<string name="fragment_debug__section_device">Device</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_spam">Debug Log (Verbose)</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__android_version">Android Version: %1$s</string>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<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__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__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__profile" translatable="false">pref_key__visibility_nav__profile</string>
|
||||
|
||||
|
||||
<!-- PodProfile -->
|
||||
<string name="pref_key__podprofile_avatar_url" translatable="false">podUserProfile_avatar</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_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 -->
|
||||
<string name="pref_cat__visuals">Appearance</string>
|
||||
<string name="pref_cat__network">Network</string>
|
||||
<string name="pref_cat__pod_settings">Pod settings</string>
|
||||
<string name="pref_cat__more" translatable="false">@string/nav_menu_more</string>
|
||||
|
||||
<!-- Visuals -->
|
||||
<!-- Navigiation Slider -->
|
||||
|
@ -110,5 +114,14 @@
|
|||
|
||||
<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>
|
||||
|
||||
<!-- 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-->
|
||||
</resources>
|
|
@ -141,4 +141,27 @@
|
|||
android:key="@string/pref_key__proxy_port"
|
||||
android:title="@string/pref_title__proxy_port"/>
|
||||
</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>
|
Loading…
Reference in a new issue