diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e7386c55..0d4976f4 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -14,11 +14,11 @@ android:theme="@style/DiasporaLight" > diff --git a/app/src/main/ic_launcher-web.png b/app/src/main/ic_launcher-web.png new file mode 100644 index 00000000..39e28103 Binary files /dev/null and b/app/src/main/ic_launcher-web.png differ diff --git a/app/src/main/java/com/github/dfa/diaspora_android/App.java b/app/src/main/java/com/github/dfa/diaspora_android/App.java index 7ca0115f..d6fcdba0 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/App.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/App.java @@ -27,10 +27,10 @@ import android.webkit.CookieManager; import android.webkit.CookieSyncManager; 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.data.DiasporaUserProfile; +import com.github.dfa.diaspora_android.service.AvatarImageLoader; import com.github.dfa.diaspora_android.util.AppLog; -import com.github.dfa.diaspora_android.util.AvatarImageLoader; +import com.github.dfa.diaspora_android.util.AppSettings; import com.github.dfa.diaspora_android.util.DiasporaUrlHelper; public class App extends Application { @@ -38,7 +38,7 @@ public class App extends Application { private AppSettings appSettings; private AvatarImageLoader avatarImageLoader; private CookieManager cookieManager; - private PodUserProfile podUserProfile; + private DiasporaUserProfile diasporaUserProfile; @Override public void onCreate() { @@ -52,7 +52,7 @@ public class App extends Application { // Init pod profile avatarImageLoader = new AvatarImageLoader(c); - podUserProfile = new PodUserProfile(this); + diasporaUserProfile = new DiasporaUserProfile(this); // Get cookie manager @@ -87,8 +87,8 @@ public class App extends Application { } } - public PodUserProfile getPodUserProfile() { - return podUserProfile; + public DiasporaUserProfile getDiasporaUserProfile() { + return diasporaUserProfile; } public AppSettings getSettings() { diff --git a/app/src/main/java/com/github/dfa/diaspora_android/activity/AboutActivity.java b/app/src/main/java/com/github/dfa/diaspora_android/activity/AboutActivity.java index 48a00d90..83d8a64f 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/activity/AboutActivity.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/activity/AboutActivity.java @@ -43,15 +43,15 @@ import android.widget.Toast; 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.fragment.ThemedFragment; +import com.github.dfa.diaspora_android.listener.IntellihideToolbarActivityListener; import com.github.dfa.diaspora_android.ui.HtmlTextView; -import com.github.dfa.diaspora_android.ui.IntellihideToolbarActivityListener; +import com.github.dfa.diaspora_android.ui.theme.ThemeHelper; +import com.github.dfa.diaspora_android.ui.theme.ThemedActivity; +import com.github.dfa.diaspora_android.ui.theme.ThemedFragment; import com.github.dfa.diaspora_android.util.AppLog; +import com.github.dfa.diaspora_android.util.AppSettings; 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.theming.ThemeHelper; import java.util.Observable; import java.util.Observer; @@ -316,7 +316,7 @@ public class AboutActivity extends ThemedActivity public boolean onLongClick(View view) { if (isAdded()) { ClipboardManager clipboard = (ClipboardManager) getActivity().getSystemService(CLIPBOARD_SERVICE); - ClipData clip = ClipData.newPlainText("DEBUG_LOG", Log.getLogBuffer()); + ClipData clip = ClipData.newPlainText("DEBUG_LOG", AppLog.Log.getLogBuffer()); clipboard.setPrimaryClip(clip); Toast.makeText(DebugFragment.this.getActivity(), R.string.fragment_debug__toast_log_copied, Toast.LENGTH_SHORT).show(); } else { @@ -325,8 +325,8 @@ public class AboutActivity extends ThemedActivity return true; } }); - Log.addLogObserver(this); - update(Log.getInstance(), null); + AppLog.Log.addLogObserver(this); + update(AppLog.Log.getInstance(), null); if (isAdded()) { try { @@ -353,14 +353,14 @@ public class AboutActivity extends ThemedActivity @Override public void onDestroyView() { - Log.removeLogObserver(this); + AppLog.Log.removeLogObserver(this); super.onDestroyView(); } @Override public void update(Observable observable, Object o) { if (logBox != null) { - logBox.setText(Log.getLogBuffer()); + logBox.setText(AppLog.Log.getLogBuffer()); } } } diff --git a/app/src/main/java/com/github/dfa/diaspora_android/fragment/AspectListFragment.java b/app/src/main/java/com/github/dfa/diaspora_android/activity/AspectListFragment.java similarity index 93% rename from app/src/main/java/com/github/dfa/diaspora_android/fragment/AspectListFragment.java rename to app/src/main/java/com/github/dfa/diaspora_android/activity/AspectListFragment.java index 1952ecc3..2eee623f 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/fragment/AspectListFragment.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/activity/AspectListFragment.java @@ -16,7 +16,7 @@ If not, see . */ -package com.github.dfa.diaspora_android.fragment; +package com.github.dfa.diaspora_android.activity; import android.content.Context; import android.graphics.PorterDuff; @@ -34,11 +34,11 @@ import android.widget.TextView; 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.data.PodAspect; +import com.github.dfa.diaspora_android.data.DiasporaAspect; import com.github.dfa.diaspora_android.listener.OnSomethingClickListener; +import com.github.dfa.diaspora_android.ui.theme.ThemedFragment; import com.github.dfa.diaspora_android.util.AppLog; +import com.github.dfa.diaspora_android.util.AppSettings; import com.github.dfa.diaspora_android.util.DiasporaUrlHelper; import com.github.dfa.diaspora_android.util.Helpers; @@ -114,7 +114,7 @@ public class AspectListFragment extends ThemedFragment implements OnSomethingCli public static class AspectAdapter extends RecyclerView.Adapter { private AppSettings appSettings; - private PodAspect[] aspectList; + private DiasporaAspect[] aspectList; private List aspectFavsList; private OnSomethingClickListener aspectClickedListener; @@ -148,7 +148,7 @@ public class AspectListFragment extends ThemedFragment implements OnSomethingCli @Override public AspectAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View v = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.recycler_view__list_item, parent, false); + .inflate(R.layout.recycler_list__list_item_with_fav, parent, false); return new ViewHolder(v); } @@ -156,10 +156,10 @@ public class AspectListFragment extends ThemedFragment implements OnSomethingCli public void onBindViewHolder(final ViewHolder holder, int position) { // Alternating colors final Context c = holder.root.getContext(); - final PodAspect aspect = aspectList[position]; + final DiasporaAspect aspect = aspectList[position]; holder.title.setText(aspect.name); if (position % 2 == 1) { - holder.root.setBackgroundColor(Helpers.getColorFromRessource(c, R.color.md_grey_300)); + holder.root.setBackgroundColor(Helpers.getColorFromRessource(c, R.color.alternate_row_color)); } // Favourite (Star) Image diff --git a/app/src/main/java/com/github/dfa/diaspora_android/fragment/DiasporaStreamFragment.java b/app/src/main/java/com/github/dfa/diaspora_android/activity/DiasporaStreamFragment.java similarity index 96% rename from app/src/main/java/com/github/dfa/diaspora_android/fragment/DiasporaStreamFragment.java rename to app/src/main/java/com/github/dfa/diaspora_android/activity/DiasporaStreamFragment.java index 89e8de24..2e02f5fe 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/fragment/DiasporaStreamFragment.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/activity/DiasporaStreamFragment.java @@ -16,7 +16,7 @@ If not, see . */ -package com.github.dfa.diaspora_android.fragment; +package com.github.dfa.diaspora_android.activity; import android.Manifest; import android.animation.ObjectAnimator; @@ -42,14 +42,14 @@ import android.webkit.WebView; 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.PodUserProfile; +import com.github.dfa.diaspora_android.data.DiasporaUserProfile; import com.github.dfa.diaspora_android.util.AppLog; import com.github.dfa.diaspora_android.util.DiasporaUrlHelper; import com.github.dfa.diaspora_android.util.Helpers; -import com.github.dfa.diaspora_android.util.WebHelper; -import com.github.dfa.diaspora_android.webview.DiasporaStreamWebChromeClient; -import com.github.dfa.diaspora_android.webview.FileUploadWebChromeClient; +import com.github.dfa.diaspora_android.web.BrowserFragment; +import com.github.dfa.diaspora_android.web.DiasporaStreamWebChromeClient; +import com.github.dfa.diaspora_android.web.FileUploadWebChromeClient; +import com.github.dfa.diaspora_android.web.WebHelper; import org.json.JSONException; @@ -328,13 +328,13 @@ public class DiasporaStreamFragment extends BrowserFragment { @SuppressWarnings("unused") @JavascriptInterface public void setUserProfile(final String webMessage) throws JSONException { - PodUserProfile pup = ((App) getActivity().getApplication()).getPodUserProfile(); + DiasporaUserProfile pup = ((App) getActivity().getApplication()).getDiasporaUserProfile(); AppLog.spam(this, "StreamFragment.JavaScriptInterface.setUserProfile()"); if (pup.isRefreshNeeded()) { - AppLog.v(this, "PodUserProfile needs refresh; Try to parse JSON"); + AppLog.v(this, "DiasporaUserProfile needs refresh; Try to parse JSON"); pup.parseJson(webMessage); } else { - AppLog.spam(this, "No PodUserProfile refresh needed"); + AppLog.spam(this, "No DiasporaUserProfile refresh needed"); } } diff --git a/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java b/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java index 9ede6ec8..e5b77eb5 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java @@ -59,37 +59,34 @@ import android.widget.Toast; 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.data.DiasporaPodList; -import com.github.dfa.diaspora_android.data.PodUserProfile; -import com.github.dfa.diaspora_android.fragment.AspectListFragment; -import com.github.dfa.diaspora_android.fragment.BrowserFragment; -import com.github.dfa.diaspora_android.fragment.CustomFragment; -import com.github.dfa.diaspora_android.fragment.DiasporaStreamFragment; -import com.github.dfa.diaspora_android.fragment.HashtagListFragment; -import com.github.dfa.diaspora_android.fragment.PodSelectionFragment; -import com.github.dfa.diaspora_android.listener.WebUserProfileChangedListener; +import com.github.dfa.diaspora_android.data.DiasporaUserProfile; +import com.github.dfa.diaspora_android.listener.DiasporaUserProfileChangedListener; +import com.github.dfa.diaspora_android.listener.IntellihideToolbarActivityListener; import com.github.dfa.diaspora_android.receiver.OpenExternalLinkReceiver; import com.github.dfa.diaspora_android.receiver.UpdateTitleReceiver; import com.github.dfa.diaspora_android.ui.BadgeDrawable; -import com.github.dfa.diaspora_android.ui.IntellihideToolbarActivityListener; import com.github.dfa.diaspora_android.ui.PodSelectionDialog; +import com.github.dfa.diaspora_android.ui.theme.CustomFragment; +import com.github.dfa.diaspora_android.ui.theme.ThemeHelper; +import com.github.dfa.diaspora_android.ui.theme.ThemedActivity; import com.github.dfa.diaspora_android.util.AppLog; -import com.github.dfa.diaspora_android.util.CustomTabHelpers.CustomTabActivityHelper; +import com.github.dfa.diaspora_android.util.AppSettings; import com.github.dfa.diaspora_android.util.DiasporaUrlHelper; -import com.github.dfa.diaspora_android.util.ProxyHandler; -import com.github.dfa.diaspora_android.util.WebHelper; -import com.github.dfa.diaspora_android.util.theming.ThemeHelper; +import com.github.dfa.diaspora_android.web.BrowserFragment; +import com.github.dfa.diaspora_android.web.ProxyHandler; +import com.github.dfa.diaspora_android.web.WebHelper; +import com.github.dfa.diaspora_android.web.custom_tab.CustomTabActivityHelper; import butterknife.BindView; import butterknife.ButterKnife; public class MainActivity extends ThemedActivity implements NavigationView.OnNavigationItemSelectedListener, - WebUserProfileChangedListener, + DiasporaUserProfileChangedListener, CustomTabActivityHelper.ConnectionCallback, IntellihideToolbarActivityListener, - PodSelectionDialog.PodSelectionDialogResultListener{ + PodSelectionDialog.PodSelectionDialogResultListener { public static final int REQUEST_CODE_ASK_PERMISSIONS = 123; @@ -110,7 +107,7 @@ public class MainActivity extends ThemedActivity private CustomTabActivityHelper customTabActivityHelper; private AppSettings appSettings; private DiasporaUrlHelper urls; - private PodUserProfile podUserProfile; + private DiasporaUserProfile diasporaUserProfile; private final Handler uiHandler = new Handler(); private OpenExternalLinkReceiver brOpenExternalLink; private BroadcastReceiver brSetTitle; @@ -168,10 +165,10 @@ public class MainActivity extends ThemedActivity 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); + if ((diasporaUserProfile = app.getDiasporaUserProfile()) == null) + AppLog.e(this, "DiasporaUserProfile is null!"); + diasporaUserProfile.setCallbackHandler(uiHandler); + diasporaUserProfile.setListener(this); urls = new DiasporaUrlHelper(appSettings); customTabActivityHelper = new CustomTabActivityHelper(); customTabActivityHelper.setConnectionCallback(this); @@ -283,8 +280,8 @@ public class MainActivity extends ThemedActivity BrowserFragment bf = new BrowserFragment(); fm.beginTransaction().add(bf, fragmentTag).commit(); return bf; - case HashtagListFragment.TAG: - HashtagListFragment hlf = new HashtagListFragment(); + case TagListFragment.TAG: + TagListFragment hlf = new TagListFragment(); fm.beginTransaction().add(hlf, fragmentTag).commit(); return hlf; case AspectListFragment.TAG: @@ -627,12 +624,12 @@ public class MainActivity extends ThemedActivity if ((item = menu.findItem(R.id.action_notifications)) != null) { LayerDrawable icon = (LayerDrawable) item.getIcon(); - BadgeDrawable.setBadgeCount(this, icon, podUserProfile.getNotificationCount()); + BadgeDrawable.setBadgeCount(this, icon, diasporaUserProfile.getNotificationCount()); } if ((item = menu.findItem(R.id.action_conversations)) != null) { LayerDrawable icon = (LayerDrawable) item.getIcon(); - BadgeDrawable.setBadgeCount(this, icon, podUserProfile.getUnreadMessagesCount()); + BadgeDrawable.setBadgeCount(this, icon, diasporaUserProfile.getUnreadMessagesCount()); } return super.onPrepareOptionsMenu(menu); } @@ -648,7 +645,7 @@ public class MainActivity extends ThemedActivity AppLog.i(this, "onOptionsItemSelected()"); switch (item.getItemId()) { case R.id.action_notifications: { - if(appSettings.isExtendedNotificationsActivated()) { + if (appSettings.isExtendedNotificationsActivated()) { return true; } //Otherwise we execute the action of action_notifications_all @@ -803,25 +800,17 @@ public class MainActivity extends ThemedActivity return super.onOptionsItemSelected(item); } - /** - * Update the profile name in the navigation slider - * - * @param name name - */ @Override - public void onUserProfileNameChanged(String name) { + public void onUserProfileNameChanged(DiasporaUserProfile diasporaUserProfile, String name) { AppLog.i(this, "onUserProfileNameChanged()"); + // Update the profile name in the navigation slider navheaderTitle.setText(name); } - /** - * Update the profile picture in the navigation slider - * - * @param avatarUrl url of the new profile pic - */ @Override - public void onUserProfileAvatarChanged(String avatarUrl) { + public void onUserProfileAvatarChanged(DiasporaUserProfile diasporaUserProfile, String avatarUrl) { AppLog.i(this, "onUserProfileAvatarChanged()"); + // Update the profile picture in the navigation slider app.getAvatarImageLoader().startImageDownload(navheaderImage, avatarUrl); } @@ -916,27 +905,20 @@ public class MainActivity extends ThemedActivity Toast.makeText(this, "Not yet implemented.", Toast.LENGTH_SHORT).show(); } - /** - * Invalidate the top toolbar to update the notification counter - * - * @param notificationCount new notification count - */ @Override - public void onNotificationCountChanged(int notificationCount) { + public void onNotificationCountChanged(DiasporaUserProfile diasporaUserProfile, int notificationCount) { AppLog.i(this, "onNotificationCountChanged()"); - // Count saved in PodUserProfile + // Count saved in DiasporaUserProfile + // Invalidate the top toolbar to update the unread messages counter invalidateOptionsMenu(); } - /** - * Invalidate the top toolbar to update the unread messages counter - * - * @param unreadMessageCount new unread messages count - */ + @Override - public void onUnreadMessageCountChanged(int unreadMessageCount) { + public void onUnreadMessageCountChanged(DiasporaUserProfile diasporaUserProfile, int unreadMessageCount) { AppLog.i(this, "onUnreadMessageCountChanged()"); - // Count saved in PodUserProfile + // Count saved in DiasporaUserProfile + // Invalidate the top toolbar to update the unread messages counter invalidateOptionsMenu(); } @@ -950,7 +932,7 @@ public class MainActivity extends ThemedActivity @Override public void onPodSelectionDialogResult(DiasporaPodList.DiasporaPod pod, boolean accepted) { - if(accepted) { + if (accepted) { invalidateOptionsMenu(); navheaderDescription.setText(pod.getName()); } @@ -986,7 +968,7 @@ public class MainActivity extends ThemedActivity break; case R.id.nav_followed_tags: { - showFragment(getFragment(HashtagListFragment.TAG)); + showFragment(getFragment(TagListFragment.TAG)); } break; @@ -997,7 +979,7 @@ public class MainActivity extends ThemedActivity break; case R.id.nav_contacts: { - if(WebHelper.isOnline(MainActivity.this)) { + if (WebHelper.isOnline(MainActivity.this)) { openDiasporaUrl(urls.getManageContactsUrl()); } else { snackbarNoInternet.show(); diff --git a/app/src/main/java/com/github/dfa/diaspora_android/fragment/PodSelectionFragment.java b/app/src/main/java/com/github/dfa/diaspora_android/activity/PodSelectionFragment.java similarity index 93% rename from app/src/main/java/com/github/dfa/diaspora_android/fragment/PodSelectionFragment.java rename to app/src/main/java/com/github/dfa/diaspora_android/activity/PodSelectionFragment.java index 62e64325..806cda26 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/fragment/PodSelectionFragment.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/activity/PodSelectionFragment.java @@ -16,13 +16,12 @@ If not, see . */ -package com.github.dfa.diaspora_android.fragment; +package com.github.dfa.diaspora_android.activity; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; -import android.content.res.Resources; import android.os.Build; import android.os.Bundle; import android.support.design.widget.Snackbar; @@ -43,16 +42,15 @@ import android.widget.TextView; 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.data.DiasporaPodList; import com.github.dfa.diaspora_android.data.DiasporaPodList.DiasporaPod; -import com.github.dfa.diaspora_android.task.GetPodsService; +import com.github.dfa.diaspora_android.service.FetchPodsService; import com.github.dfa.diaspora_android.ui.PodSelectionDialog; +import com.github.dfa.diaspora_android.ui.theme.ThemedFragment; import com.github.dfa.diaspora_android.util.AppLog; +import com.github.dfa.diaspora_android.util.AppSettings; import com.github.dfa.diaspora_android.util.DiasporaUrlHelper; import com.github.dfa.diaspora_android.util.Helpers; -import com.github.dfa.diaspora_android.util.theming.ThemeHelper; import org.json.JSONException; import org.json.JSONObject; @@ -117,7 +115,7 @@ public class PodSelectionFragment extends ThemedFragment implements SearchView.O } }); - LocalBroadcastManager.getInstance(getContext()).registerReceiver(podListReceiver, new IntentFilter(GetPodsService.MESSAGE_PODS_RECEIVED)); + LocalBroadcastManager.getInstance(getContext()).registerReceiver(podListReceiver, new IntentFilter(FetchPodsService.MESSAGE_PODS_RECEIVED)); Helpers.showInfoIfUserNotConnectedToInternet(getContext(), listViewPod); } @@ -144,9 +142,9 @@ public class PodSelectionFragment extends ThemedFragment implements SearchView.O private final BroadcastReceiver podListReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { - if (intent.hasExtra(GetPodsService.EXTRA_PODLIST)) { + if (intent.hasExtra(FetchPodsService.EXTRA_PODLIST)) { Bundle extras = intent.getExtras(); - DiasporaPodList newPods = (DiasporaPodList) extras.get(GetPodsService.EXTRA_PODLIST); + DiasporaPodList newPods = (DiasporaPodList) extras.get(FetchPodsService.EXTRA_PODLIST); if (newPods != null && newPods.getPods().size() > 0) { try { podList.mergeWithNewerEntries(newPods); @@ -168,7 +166,7 @@ public class PodSelectionFragment extends ThemedFragment implements SearchView.O @Override public void onResume() { super.onResume(); - Intent i = new Intent(getContext(), GetPodsService.class); + Intent i = new Intent(getContext(), FetchPodsService.class); getContext().startService(i); } @@ -222,7 +220,7 @@ public class PodSelectionFragment extends ThemedFragment implements SearchView.O switch (item.getItemId()) { case R.id.action_reload: { if (!Helpers.showInfoIfUserNotConnectedToInternet(getContext(), listViewPod)) { - Intent i = new Intent(getContext(), GetPodsService.class); + Intent i = new Intent(getContext(), FetchPodsService.class); getContext().startService(i); return true; } diff --git a/app/src/main/java/com/github/dfa/diaspora_android/activity/SettingsActivity.java b/app/src/main/java/com/github/dfa/diaspora_android/activity/SettingsActivity.java index 009585d0..1488a0b9 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/activity/SettingsActivity.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/activity/SettingsActivity.java @@ -22,13 +22,14 @@ import android.widget.TextView; 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.fragment.ThemedPreferenceFragment; +import com.github.dfa.diaspora_android.ui.theme.ColorPalette; +import com.github.dfa.diaspora_android.ui.theme.ThemeHelper; +import com.github.dfa.diaspora_android.ui.theme.ThemedActivity; +import com.github.dfa.diaspora_android.ui.theme.ThemedPreferenceFragment; import com.github.dfa.diaspora_android.util.AppLog; +import com.github.dfa.diaspora_android.util.AppSettings; import com.github.dfa.diaspora_android.util.DiasporaUrlHelper; -import com.github.dfa.diaspora_android.util.ProxyHandler; -import com.github.dfa.diaspora_android.util.theming.ColorPalette; -import com.github.dfa.diaspora_android.util.theming.ThemeHelper; +import com.github.dfa.diaspora_android.web.ProxyHandler; import butterknife.BindView; import butterknife.ButterKnife; @@ -72,7 +73,7 @@ public class SettingsActivity extends ThemedActivity { protected void showFragment(String tag, boolean addToBackStack) { PreferenceFragment fragment = (PreferenceFragment) getFragmentManager().findFragmentByTag(tag); - if(fragment == null) { + if (fragment == null) { switch (tag) { case SettingsFragmentThemes.TAG: fragment = new SettingsFragmentThemes(); @@ -93,7 +94,7 @@ public class SettingsActivity extends ThemedActivity { } } FragmentTransaction t = getFragmentManager().beginTransaction(); - if(addToBackStack) { + if (addToBackStack) { t.addToBackStack(tag); } t.replace(R.id.settings__fragment_container, fragment, tag).commit(); @@ -142,26 +143,26 @@ public class SettingsActivity extends ThemedActivity { @Override public boolean onPreferenceTreeClick(PreferenceScreen screen, Preference preference) { - if(isAdded() && preference.hasKey()) { - AppSettings settings = ((App)getActivity().getApplication()).getSettings(); + if (isAdded() && preference.hasKey()) { + AppSettings settings = ((App) getActivity().getApplication()).getSettings(); DiasporaUrlHelper diasporaUrlHelper = new DiasporaUrlHelper(settings); String key = preference.getKey(); /** Sub-Categories */ - if(settings.isKeyEqual(key,R.string.pref_key__cat_themes)) { + if (settings.isKeyEqual(key, R.string.pref_key__cat_themes)) { ((SettingsActivity) getActivity()).showFragment(SettingsFragmentThemes.TAG, true); return true; - } else if (settings.isKeyEqual(key,R.string.pref_key__cat_nav_slider)) { + } else if (settings.isKeyEqual(key, R.string.pref_key__cat_nav_slider)) { ((SettingsActivity) getActivity()).showFragment(SettingsFragmentNavSlider.TAG, true); return true; - } else if (settings.isKeyEqual(key,R.string.pref_key__cat_proxy)) { - ((SettingsActivity)getActivity()).showFragment(SettingsFragmentProxy.TAG, true); + } else if (settings.isKeyEqual(key, R.string.pref_key__cat_proxy)) { + ((SettingsActivity) getActivity()).showFragment(SettingsFragmentProxy.TAG, true); return true; - } else if (settings.isKeyEqual(key,R.string.pref_key__cat_debugging)) { - ((SettingsActivity)getActivity()).showFragment(SettingsFragmentDebugging.TAG, true); + } else if (settings.isKeyEqual(key, R.string.pref_key__cat_debugging)) { + ((SettingsActivity) getActivity()).showFragment(SettingsFragmentDebugging.TAG, true); return true; } /** Network */ - else if (settings.isKeyEqual(key,R.string.pref_key__clear_cache)) { + else if (settings.isKeyEqual(key, R.string.pref_key__clear_cache)) { Intent intent = new Intent(getActivity(), MainActivity.class); intent.setAction(MainActivity.ACTION_CLEAR_CACHE); startActivity(intent); @@ -169,28 +170,28 @@ public class SettingsActivity extends ThemedActivity { return true; } /** Pod Settings */ - if (settings.isKeyEqual(key,R.string.pref_key__personal_settings)) { + if (settings.isKeyEqual(key, R.string.pref_key__personal_settings)) { Intent intent = new Intent(getActivity(), MainActivity.class); intent.setAction(MainActivity.ACTION_OPEN_URL); intent.putExtra(MainActivity.URL_MESSAGE, diasporaUrlHelper.getPersonalSettingsUrl()); startActivity(intent); getActivity().finish(); return true; - } else if (settings.isKeyEqual(key,R.string.pref_key__manage_tags)) { + } else if (settings.isKeyEqual(key, R.string.pref_key__manage_tags)) { Intent intent = new Intent(getActivity(), MainActivity.class); intent.setAction(MainActivity.ACTION_OPEN_URL); intent.putExtra(MainActivity.URL_MESSAGE, diasporaUrlHelper.getManageTagsUrl()); startActivity(intent); getActivity().finish(); return true; - } else if (settings.isKeyEqual(key,R.string.pref_key__manage_contacts)) { + } else if (settings.isKeyEqual(key, R.string.pref_key__manage_contacts)) { Intent intent = new Intent(getActivity(), MainActivity.class); intent.setAction(MainActivity.ACTION_OPEN_URL); intent.putExtra(MainActivity.URL_MESSAGE, diasporaUrlHelper.getManageContactsUrl()); startActivity(intent); getActivity().finish(); return true; - } else if (settings.isKeyEqual(key,R.string.pref_key__change_account)) { + } else if (settings.isKeyEqual(key, R.string.pref_key__change_account)) { new AlertDialog.Builder(getActivity()) .setTitle(getString(R.string.confirmation)) .setMessage(getString(R.string.pref_warning__change_account)) @@ -224,7 +225,7 @@ public class SettingsActivity extends ThemedActivity { @Override public void updateViewColors() { - if(isAdded()) { + if (isAdded()) { //Trigger redraw of whole preference screen in order to reflect changes setPreferenceScreen(null); addPreferencesFromResource(R.xml.preferences__sub_themes); @@ -235,7 +236,7 @@ public class SettingsActivity extends ThemedActivity { public boolean onPreferenceTreeClick(PreferenceScreen screen, Preference preference) { if (isAdded() && preference.hasKey()) { String key = preference.getKey(); - if(key.equals(getString(R.string.pref_key__primary_color__preference_click))) { + if (key.equals(getString(R.string.pref_key__primary_color__preference_click))) { showColorPickerDialog(1); return true; } else if (key.equals(getString(R.string.pref_key__accent_color__preference_click))) { @@ -257,7 +258,7 @@ public class SettingsActivity extends ThemedActivity { //Inflate dialog layout LayoutInflater inflater = getActivity().getLayoutInflater(); - View dialogLayout = inflater.inflate(R.layout.color_picker__dialog, null); + View dialogLayout = inflater.inflate(R.layout.ui__dialog__color_picker, null); final android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(context); builder.setView(dialogLayout); @@ -305,7 +306,7 @@ public class SettingsActivity extends ThemedActivity { if (Build.VERSION.SDK_INT >= 21) { getActivity().getWindow().setStatusBarColor(ThemeHelper.getPrimaryDarkColor()); } - ((ThemedActivity) getActivity()).applyColorToViews(); + ((SettingsActivity) getActivity()).applyColorToViews(); } else { appSettings.setAccentColorSettings(base.getColor(), shade.getColor()); } @@ -348,7 +349,7 @@ public class SettingsActivity extends ThemedActivity { } public void updateSummaries() { - if(isAdded()) { + if (isAdded()) { AppSettings settings = ((App) getActivity().getApplication()).getSettings(); findPreference(settings.getKey(R.string.pref_key__http_proxy_host)).setSummary(settings.getProxyHttpHost()); findPreference(settings.getKey(R.string.pref_key__http_proxy_port)).setSummary(Integer.toString(settings.getProxyHttpPort())); @@ -360,7 +361,7 @@ public class SettingsActivity extends ThemedActivity { if (isAdded() && preference.hasKey()) { AppSettings appSettings = ((App) getActivity().getApplication()).getSettings(); String key = preference.getKey(); - if(appSettings.isKeyEqual(key, R.string.pref_key__http_proxy_load_tor_preset)) { + if (appSettings.isKeyEqual(key, R.string.pref_key__http_proxy_load_tor_preset)) { appSettings.setProxyHttpHost("127.0.0.1"); appSettings.setProxyHttpPort(8118); return true; @@ -376,7 +377,7 @@ public class SettingsActivity extends ThemedActivity { @Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { - if(isAdded()) { + if (isAdded()) { if (key.equals(getString(R.string.pref_key__http_proxy_host)) || key.equals(getString(R.string.pref_key__http_proxy_port))) { updateSummaries(); diff --git a/app/src/main/java/com/github/dfa/diaspora_android/fragment/HashtagListFragment.java b/app/src/main/java/com/github/dfa/diaspora_android/activity/TagListFragment.java similarity index 94% rename from app/src/main/java/com/github/dfa/diaspora_android/fragment/HashtagListFragment.java rename to app/src/main/java/com/github/dfa/diaspora_android/activity/TagListFragment.java index 143c089a..6f016c39 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/fragment/HashtagListFragment.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/activity/TagListFragment.java @@ -16,7 +16,7 @@ If not, see . */ -package com.github.dfa.diaspora_android.fragment; +package com.github.dfa.diaspora_android.activity; import android.content.Context; import android.graphics.PorterDuff; @@ -34,10 +34,10 @@ import android.widget.TextView; 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.listener.OnSomethingClickListener; +import com.github.dfa.diaspora_android.ui.theme.ThemedFragment; import com.github.dfa.diaspora_android.util.AppLog; +import com.github.dfa.diaspora_android.util.AppSettings; import com.github.dfa.diaspora_android.util.DiasporaUrlHelper; import com.github.dfa.diaspora_android.util.Helpers; @@ -51,9 +51,9 @@ import butterknife.ButterKnife; /** * Fragment that shows a list of the HashTags the user follows */ -public class HashtagListFragment extends ThemedFragment implements OnSomethingClickListener { +public class TagListFragment extends ThemedFragment implements OnSomethingClickListener { - public static final String TAG = "com.github.dfa.diaspora_android.HashtagListFragment"; + public static final String TAG = "com.github.dfa.diaspora_android.TagListFragment"; protected RecyclerView followedTagsRecyclerView; protected App app; @@ -147,7 +147,7 @@ public class HashtagListFragment extends ThemedFragment implements OnSomethingCl @Override public FollowedTagsAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View v = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.recycler_view__list_item, parent, false); + .inflate(R.layout.recycler_list__list_item_with_fav, parent, false); return new ViewHolder(v); } @@ -158,7 +158,7 @@ public class HashtagListFragment extends ThemedFragment implements OnSomethingCl final String tag = followedTagsList[position]; holder.title.setText(tag); if (position % 2 == 1) { - holder.root.setBackgroundColor(Helpers.getColorFromRessource(c, R.color.md_grey_300)); + holder.root.setBackgroundColor(Helpers.getColorFromRessource(c, R.color.alternate_row_color)); } // Favourite (Star) Image diff --git a/app/src/main/java/com/github/dfa/diaspora_android/data/PodAspect.java b/app/src/main/java/com/github/dfa/diaspora_android/data/DiasporaAspect.java similarity index 87% rename from app/src/main/java/com/github/dfa/diaspora_android/data/PodAspect.java rename to app/src/main/java/com/github/dfa/diaspora_android/data/DiasporaAspect.java index 7c9c2fab..c37f01a4 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/data/PodAspect.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/data/DiasporaAspect.java @@ -19,25 +19,26 @@ package com.github.dfa.diaspora_android.data; import com.github.dfa.diaspora_android.App; +import com.github.dfa.diaspora_android.util.AppSettings; import org.json.JSONException; import org.json.JSONObject; import java.util.Locale; -public class PodAspect { +public class DiasporaAspect { public long id; public String name; public boolean selected; - public PodAspect(long id, String name, boolean selected) { + public DiasporaAspect(long id, String name, boolean selected) { this.id = id; this.name = name; this.selected = selected; } - public PodAspect(String shareabletext) { + public DiasporaAspect(String shareabletext) { // fromShareAbleText String[] str = shareabletext.split("%"); selected = Integer.parseInt(str[0]) == 1; @@ -45,7 +46,7 @@ public class PodAspect { name = shareabletext.substring(shareabletext.indexOf(str[1]) + str[1].length() + 1); } - public PodAspect(JSONObject json) throws JSONException { + public DiasporaAspect(JSONObject json) throws JSONException { if (json.has("id")) { id = json.getLong("id"); } @@ -81,7 +82,7 @@ public class PodAspect { @Override public boolean equals(Object o) { - return o instanceof PodAspect && ((PodAspect) o).id == id; + return o instanceof DiasporaAspect && ((DiasporaAspect) o).id == id; } public String toShareAbleText() { diff --git a/app/src/main/java/com/github/dfa/diaspora_android/data/PodUserProfile.java b/app/src/main/java/com/github/dfa/diaspora_android/data/DiasporaUserProfile.java similarity index 82% rename from app/src/main/java/com/github/dfa/diaspora_android/data/PodUserProfile.java rename to app/src/main/java/com/github/dfa/diaspora_android/data/DiasporaUserProfile.java index dabd8b2d..f0886550 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/data/PodUserProfile.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/data/DiasporaUserProfile.java @@ -21,8 +21,9 @@ package com.github.dfa.diaspora_android.data; import android.os.Handler; import com.github.dfa.diaspora_android.App; -import com.github.dfa.diaspora_android.listener.WebUserProfileChangedListener; +import com.github.dfa.diaspora_android.listener.DiasporaUserProfileChangedListener; import com.github.dfa.diaspora_android.util.AppLog; +import com.github.dfa.diaspora_android.util.AppSettings; import org.json.JSONArray; import org.json.JSONException; @@ -32,47 +33,47 @@ import org.json.JSONObject; * User profile * Created by gsantner (https://gsantner.github.io/) on 24.03.16. Part of Diaspora for Android. */ -public class PodUserProfile { - private static final int MINIMUM_WEBUSERPROFILE_LOAD_TIMEDIFF = 5000; +public class DiasporaUserProfile { + private static final int MINIMUM_USERPROFILE_LOAD_TIMEDIFF = 5000; private Handler callbackHandler; - private WebUserProfileChangedListener listener; + private DiasporaUserProfileChangedListener listener; private final App app; private final AppSettings appSettings; private JSONObject json; - private long lastLoaded; + private long userProfileLastLoadedTimestamp; private boolean isWebUserProfileLoaded; private String avatarUrl; private String guid; private String name; - private PodAspect[] podAspects; + private DiasporaAspect[] aspects; private String[] followedTags; private int notificationCount; private int unreadMessagesCount; - public PodUserProfile(App app) { + public DiasporaUserProfile(App app) { this.app = app; appSettings = app.getSettings(); avatarUrl = appSettings.getAvatarUrl(); guid = appSettings.getProfileId(); name = appSettings.getName(); - podAspects = appSettings.getAspects(); + aspects = appSettings.getAspects(); followedTags = appSettings.getFollowedTags(); notificationCount = appSettings.getNotificationCount(); unreadMessagesCount = appSettings.getUnreadMessageCount(); } - public PodUserProfile(App app, Handler callbackHandler, WebUserProfileChangedListener listener) { + public DiasporaUserProfile(App app, Handler callbackHandler, DiasporaUserProfileChangedListener listener) { this(app); this.listener = listener; this.callbackHandler = callbackHandler; } public boolean isRefreshNeeded() { - return (System.currentTimeMillis() - lastLoaded) >= MINIMUM_WEBUSERPROFILE_LOAD_TIMEDIFF; + return (System.currentTimeMillis() - userProfileLastLoadedTimestamp) >= MINIMUM_USERPROFILE_LOAD_TIMEDIFF; } public boolean isWebUserProfileLoaded() { @@ -82,7 +83,7 @@ public class PodUserProfile { public boolean parseJson(String jsonStr) { try { json = new JSONObject(jsonStr); - lastLoaded = System.currentTimeMillis(); + userProfileLastLoadedTimestamp = System.currentTimeMillis(); // Avatar if (json.has("avatar")) { @@ -115,7 +116,7 @@ public class PodUserProfile { // Aspect if (json.has("aspects") && loadAspects(json.getJSONArray("aspects"))) { - appSettings.setPodAspects(podAspects); + appSettings.setPodAspects(aspects); } // Followed tags @@ -129,7 +130,7 @@ public class PodUserProfile { AppLog.d(this, e.getMessage()); isWebUserProfileLoaded = false; } - lastLoaded = System.currentTimeMillis(); + userProfileLastLoadedTimestamp = System.currentTimeMillis(); return isWebUserProfileLoaded; } @@ -157,8 +158,8 @@ public class PodUserProfile { return unreadMessagesCount; } - public PodAspect[] getAspects() { - return podAspects; + public DiasporaAspect[] getAspects() { + return aspects; } public String[] getFollowedTags() { @@ -181,7 +182,7 @@ public class PodUserProfile { if (listener != null && callbackHandler != null) { callbackHandler.post(new Runnable() { public void run() { - listener.onUserProfileAvatarChanged(avatarUrl); + listener.onUserProfileAvatarChanged(DiasporaUserProfile.this, avatarUrl); } }); } @@ -204,7 +205,7 @@ public class PodUserProfile { if (listener != null && callbackHandler != null) { callbackHandler.post(new Runnable() { public void run() { - listener.onUserProfileNameChanged(name); + listener.onUserProfileNameChanged(DiasporaUserProfile.this, name); } }); } @@ -219,7 +220,7 @@ public class PodUserProfile { if (listener != null && callbackHandler != null) { callbackHandler.post(new Runnable() { public void run() { - listener.onNotificationCountChanged(notificationCount); + listener.onNotificationCountChanged(DiasporaUserProfile.this, notificationCount); } }); } @@ -229,9 +230,9 @@ public class PodUserProfile { } private boolean loadAspects(final JSONArray jsonAspects) throws JSONException { - podAspects = new PodAspect[jsonAspects.length()]; + aspects = new DiasporaAspect[jsonAspects.length()]; for (int i = 0; i < jsonAspects.length(); i++) { - podAspects[i] = new PodAspect(jsonAspects.getJSONObject(i)); + aspects[i] = new DiasporaAspect(jsonAspects.getJSONObject(i)); } return true; } @@ -250,7 +251,7 @@ public class PodUserProfile { if (listener != null && callbackHandler != null) { callbackHandler.post(new Runnable() { public void run() { - listener.onUnreadMessageCountChanged(unreadMessagesCount); + listener.onUnreadMessageCountChanged(DiasporaUserProfile.this, unreadMessagesCount); } }); } @@ -267,11 +268,11 @@ public class PodUserProfile { this.callbackHandler = callbackHandler; } - public WebUserProfileChangedListener getListener() { + public DiasporaUserProfileChangedListener getListener() { return listener; } - public void setListener(WebUserProfileChangedListener listener) { + public void setListener(DiasporaUserProfileChangedListener listener) { this.listener = listener; } diff --git a/app/src/main/java/com/github/dfa/diaspora_android/listener/DiasporaUserProfileChangedListener.java b/app/src/main/java/com/github/dfa/diaspora_android/listener/DiasporaUserProfileChangedListener.java new file mode 100644 index 00000000..4de59701 --- /dev/null +++ b/app/src/main/java/com/github/dfa/diaspora_android/listener/DiasporaUserProfileChangedListener.java @@ -0,0 +1,55 @@ +/* + This file is part of the Diaspora for Android. + + Diaspora for Android is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Diaspora for Android is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with the Diaspora for Android. + + If not, see . + */ +package com.github.dfa.diaspora_android.listener; + +import com.github.dfa.diaspora_android.data.DiasporaUserProfile; + +/** + * Created by gsantner (https://gsantner.github.io/) on 26.03.16. + * Interface that needs to be implemented by classes that listen for Profile related changes + */ +public interface DiasporaUserProfileChangedListener { + /** + * Called when the DiasporaUserProfile name changed + * @param diasporaUserProfile The profile + * @param name The new name + */ + void onUserProfileNameChanged(DiasporaUserProfile diasporaUserProfile, String name); + + /** + * Called when the DiasporaUserProfile avatarUrl changed + * @param diasporaUserProfile The profile + * @param avatarUrl The new name + */ + void onUserProfileAvatarChanged(DiasporaUserProfile diasporaUserProfile, String avatarUrl); + + /** + * Called when the DiasporaUserProfile notificationCount changed + * @param diasporaUserProfile The profile + * @param notificationCount The new notificationCount + */ + void onNotificationCountChanged(DiasporaUserProfile diasporaUserProfile, int notificationCount); + + /** + * Called when the DiasporaUserProfile unreadMessageCount changed + * @param diasporaUserProfile The profile + * @param unreadMessageCount The new unreadMessageCount + */ + void onUnreadMessageCountChanged(DiasporaUserProfile diasporaUserProfile, int unreadMessageCount); +} diff --git a/app/src/main/java/com/github/dfa/diaspora_android/ui/IntellihideToolbarActivityListener.java b/app/src/main/java/com/github/dfa/diaspora_android/listener/IntellihideToolbarActivityListener.java similarity index 90% rename from app/src/main/java/com/github/dfa/diaspora_android/ui/IntellihideToolbarActivityListener.java rename to app/src/main/java/com/github/dfa/diaspora_android/listener/IntellihideToolbarActivityListener.java index c3fd6406..dbb51587 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/ui/IntellihideToolbarActivityListener.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/listener/IntellihideToolbarActivityListener.java @@ -1,4 +1,4 @@ -package com.github.dfa.diaspora_android.ui; +package com.github.dfa.diaspora_android.listener; import android.support.design.widget.AppBarLayout; diff --git a/app/src/main/java/com/github/dfa/diaspora_android/listener/WebUserProfileChangedListener.java b/app/src/main/java/com/github/dfa/diaspora_android/listener/WebUserProfileChangedListener.java deleted file mode 100644 index 9ef24a1f..00000000 --- a/app/src/main/java/com/github/dfa/diaspora_android/listener/WebUserProfileChangedListener.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - This file is part of the Diaspora for Android. - - Diaspora for Android is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Diaspora for Android is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with the Diaspora for Android. - - If not, see . - */ -package com.github.dfa.diaspora_android.listener; - -/** - * Created by gsantner (https://gsantner.github.io/) on 26.03.16. - * Interface that needs to be implemented by classes that listen for Profile related changes - */ -public interface WebUserProfileChangedListener { - void onUserProfileNameChanged(String name); - - void onUserProfileAvatarChanged(String avatarUrl); - - void onNotificationCountChanged(int notificationCount); - - void onUnreadMessageCountChanged(int unreadMessageCount); -} diff --git a/app/src/main/java/com/github/dfa/diaspora_android/receiver/OpenExternalLinkReceiver.java b/app/src/main/java/com/github/dfa/diaspora_android/receiver/OpenExternalLinkReceiver.java index add3f685..a5456703 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/receiver/OpenExternalLinkReceiver.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/receiver/OpenExternalLinkReceiver.java @@ -29,11 +29,11 @@ import android.support.customtabs.CustomTabsIntent; 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.ui.theme.ThemeHelper; 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.theming.ThemeHelper; +import com.github.dfa.diaspora_android.util.AppSettings; +import com.github.dfa.diaspora_android.web.custom_tab.BrowserFallback; +import com.github.dfa.diaspora_android.web.custom_tab.CustomTabActivityHelper; /** * BroadcastReceiver that opens links in a Chrome CustomTab diff --git a/app/src/main/java/com/github/dfa/diaspora_android/receiver/UpdateTitleReceiver.java b/app/src/main/java/com/github/dfa/diaspora_android/receiver/UpdateTitleReceiver.java index ca8eda16..c04f0ffe 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/receiver/UpdateTitleReceiver.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/receiver/UpdateTitleReceiver.java @@ -25,8 +25,8 @@ import android.content.Intent; 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.AppSettings; import com.github.dfa.diaspora_android.util.DiasporaUrlHelper; /** diff --git a/app/src/main/java/com/github/dfa/diaspora_android/util/AvatarImageLoader.java b/app/src/main/java/com/github/dfa/diaspora_android/service/AvatarImageLoader.java similarity index 94% rename from app/src/main/java/com/github/dfa/diaspora_android/util/AvatarImageLoader.java rename to app/src/main/java/com/github/dfa/diaspora_android/service/AvatarImageLoader.java index d8857d80..545273bd 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/util/AvatarImageLoader.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/service/AvatarImageLoader.java @@ -17,15 +17,13 @@ If not, see . */ -package com.github.dfa.diaspora_android.util; +package com.github.dfa.diaspora_android.service; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.widget.ImageView; -import com.github.dfa.diaspora_android.task.ImageDownloadTask; - import java.io.File; public class AvatarImageLoader { diff --git a/app/src/main/java/com/github/dfa/diaspora_android/task/GetPodsService.java b/app/src/main/java/com/github/dfa/diaspora_android/service/FetchPodsService.java similarity index 96% rename from app/src/main/java/com/github/dfa/diaspora_android/task/GetPodsService.java rename to app/src/main/java/com/github/dfa/diaspora_android/service/FetchPodsService.java index 0b6a510b..46caccbc 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/task/GetPodsService.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/service/FetchPodsService.java @@ -16,7 +16,7 @@ If not, see . */ -package com.github.dfa.diaspora_android.task; +package com.github.dfa.diaspora_android.service; import android.app.Service; import android.content.Intent; @@ -38,12 +38,12 @@ import javax.net.ssl.HttpsURLConnection; import info.guardianproject.netcipher.NetCipher; -public class GetPodsService extends Service { +public class FetchPodsService extends Service { public static final String EXTRA_PODLIST = "pods"; public static final String MESSAGE_PODS_RECEIVED = "com.github.dfa.diaspora.podsreceived"; public static final String PODDY_PODLIST_URL = "https://raw.githubusercontent.com/Diaspora-for-Android/diaspora-android-extras/master/podList/podlist.json"; - public GetPodsService() { + public FetchPodsService() { } @Override diff --git a/app/src/main/java/com/github/dfa/diaspora_android/data/HashtagProvider.java b/app/src/main/java/com/github/dfa/diaspora_android/service/HashtagContentProvider.java similarity index 93% rename from app/src/main/java/com/github/dfa/diaspora_android/data/HashtagProvider.java rename to app/src/main/java/com/github/dfa/diaspora_android/service/HashtagContentProvider.java index bcd18511..c345b4e5 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/data/HashtagProvider.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/service/HashtagContentProvider.java @@ -18,14 +18,14 @@ This file is inspired from sourabhsoni.com/implementing-hashtags-in-android-application/ */ -package com.github.dfa.diaspora_android.data; +package com.github.dfa.diaspora_android.service; import android.content.ContentProvider; import android.content.ContentValues; import android.database.Cursor; import android.net.Uri; -public class HashtagProvider extends ContentProvider { +public class HashtagContentProvider extends ContentProvider { @Override public int delete(Uri arg0, String arg1, String[] arg2) { diff --git a/app/src/main/java/com/github/dfa/diaspora_android/task/ImageDownloadTask.java b/app/src/main/java/com/github/dfa/diaspora_android/service/ImageDownloadTask.java similarity index 98% rename from app/src/main/java/com/github/dfa/diaspora_android/task/ImageDownloadTask.java rename to app/src/main/java/com/github/dfa/diaspora_android/service/ImageDownloadTask.java index b7e9ff99..2b1902ed 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/task/ImageDownloadTask.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/service/ImageDownloadTask.java @@ -16,7 +16,7 @@ If not, see . */ -package com.github.dfa.diaspora_android.task; +package com.github.dfa.diaspora_android.service; import android.graphics.Bitmap; import android.graphics.BitmapFactory; diff --git a/app/src/main/java/com/github/dfa/diaspora_android/task/ProfileFetchTask.java b/app/src/main/java/com/github/dfa/diaspora_android/service/ProfileFetchTask.java similarity index 95% rename from app/src/main/java/com/github/dfa/diaspora_android/task/ProfileFetchTask.java rename to app/src/main/java/com/github/dfa/diaspora_android/service/ProfileFetchTask.java index e4b5835b..072b1f7e 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/task/ProfileFetchTask.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/service/ProfileFetchTask.java @@ -16,14 +16,14 @@ If not, see . */ -package com.github.dfa.diaspora_android.task; +package com.github.dfa.diaspora_android.service; import android.content.Context; import android.os.AsyncTask; import android.webkit.CookieManager; import com.github.dfa.diaspora_android.App; -import com.github.dfa.diaspora_android.data.PodUserProfile; +import com.github.dfa.diaspora_android.data.DiasporaUserProfile; import com.github.dfa.diaspora_android.util.AppLog; import com.github.dfa.diaspora_android.util.DiasporaUrlHelper; @@ -99,7 +99,7 @@ public class ProfileFetchTask extends AsyncTask { if (extractedProfileData != null) { - PodUserProfile profile = new PodUserProfile(app); + DiasporaUserProfile profile = new DiasporaUserProfile(app); profile.parseJson(extractedProfileData); AppLog.d(this, "Extracted new_messages (service):" + profile.getUnreadMessagesCount()); } diff --git a/app/src/main/java/com/github/dfa/diaspora_android/task/StatisticsFetchTask.java b/app/src/main/java/com/github/dfa/diaspora_android/service/StatisticsFetchTask.java similarity index 98% rename from app/src/main/java/com/github/dfa/diaspora_android/task/StatisticsFetchTask.java rename to app/src/main/java/com/github/dfa/diaspora_android/service/StatisticsFetchTask.java index b8b0b0e9..f06bcbd7 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/task/StatisticsFetchTask.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/service/StatisticsFetchTask.java @@ -16,7 +16,7 @@ If not, see . */ -package com.github.dfa.diaspora_android.task; +package com.github.dfa.diaspora_android.service; import android.content.Context; import android.os.AsyncTask; diff --git a/app/src/main/java/com/github/dfa/diaspora_android/ui/BadgeDrawable.java b/app/src/main/java/com/github/dfa/diaspora_android/ui/BadgeDrawable.java index cc585aea..ef74eafc 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/ui/BadgeDrawable.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/ui/BadgeDrawable.java @@ -31,7 +31,7 @@ import android.graphics.drawable.LayerDrawable; import android.support.v4.content.ContextCompat; import com.github.dfa.diaspora_android.R; -import com.github.dfa.diaspora_android.data.AppSettings; +import com.github.dfa.diaspora_android.util.AppSettings; public class BadgeDrawable extends Drawable { // Source: http://mobikul.com/adding-badge-count-on-menu-items-like-cart-notification-etc/ diff --git a/app/src/main/java/com/github/dfa/diaspora_android/ui/HtmlTextView.java b/app/src/main/java/com/github/dfa/diaspora_android/ui/HtmlTextView.java index 9274e701..fca6c04c 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/ui/HtmlTextView.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/ui/HtmlTextView.java @@ -36,7 +36,7 @@ import java.util.regex.Pattern; * TextView, that renders HTML with highlited and clickable links and hashtags. * Links are opened in a webbrowser. * Hashtags open the MainActivity, load the new-post site of the selected pod and insert the - * hashtag into the post editor. See data/HashtagProvider. + * hashtag into the post editor. See data/HashtagContentProvider. */ public class HtmlTextView extends TextView { diff --git a/app/src/main/java/com/github/dfa/diaspora_android/ui/PodSelectionDialog.java b/app/src/main/java/com/github/dfa/diaspora_android/ui/PodSelectionDialog.java index 62a78550..663ae5f4 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/ui/PodSelectionDialog.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/ui/PodSelectionDialog.java @@ -5,7 +5,6 @@ import android.app.Dialog; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v7.app.AlertDialog; -import android.support.v7.app.AppCompatDialogFragment; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; @@ -18,12 +17,12 @@ import android.widget.TextView; 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.data.DiasporaPodList.DiasporaPod; import com.github.dfa.diaspora_android.data.DiasporaPodList.DiasporaPod.DiasporaPodUrl; -import com.github.dfa.diaspora_android.fragment.ThemedAppCompatDialogFragment; -import com.github.dfa.diaspora_android.util.ProxyHandler; -import com.github.dfa.diaspora_android.util.theming.ThemeHelper; +import com.github.dfa.diaspora_android.ui.theme.ThemeHelper; +import com.github.dfa.diaspora_android.ui.theme.ThemedAppCompatDialogFragment; +import com.github.dfa.diaspora_android.util.AppSettings; +import com.github.dfa.diaspora_android.web.ProxyHandler; import org.json.JSONException; @@ -38,7 +37,7 @@ import butterknife.OnItemSelected; * Created by gsantner (https://gsantner.github.io) on 06.10.16. */ public class PodSelectionDialog extends ThemedAppCompatDialogFragment { - public static final String TAG = "com.github.dfa.diaspora_android.PodSelectionDialog"; + public static final String TAG = "com.github.dfa.diaspora_android.ui.PodSelectionDialog"; public static interface PodSelectionDialogResultListener { void onPodSelectionDialogResult(DiasporaPod pod, boolean accepted); @@ -145,7 +144,7 @@ public class PodSelectionDialog extends ThemedAppCompatDialogFragment { @Override protected AppSettings getAppSettings() { - if(isAdded()) { + if (isAdded()) { return ((App) getActivity().getApplication()).getSettings(); } else { return new AppSettings(getContext().getApplicationContext()); @@ -202,7 +201,7 @@ public class PodSelectionDialog extends ThemedAppCompatDialogFragment { pod.getPodUrls().add(podUrl); // Load Tor preset - if(pod.getPodUrl().getHost().endsWith(".onion") && checkboxTorPreset.isChecked()){ + if (pod.getPodUrl().getHost().endsWith(".onion") && checkboxTorPreset.isChecked()) { AppSettings settings = app.getSettings(); settings.setProxyHttpEnabled(true); settings.setProxyWasEnabled(false); diff --git a/app/src/main/java/com/github/dfa/diaspora_android/util/theming/ColorPalette.java b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ColorPalette.java similarity index 99% rename from app/src/main/java/com/github/dfa/diaspora_android/util/theming/ColorPalette.java rename to app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ColorPalette.java index 160ea719..d15000ad 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/util/theming/ColorPalette.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ColorPalette.java @@ -1,4 +1,4 @@ -package com.github.dfa.diaspora_android.util.theming; +package com.github.dfa.diaspora_android.ui.theme; import android.content.Context; import android.graphics.Color; diff --git a/app/src/main/java/com/github/dfa/diaspora_android/fragment/CustomFragment.java b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/CustomFragment.java similarity index 96% rename from app/src/main/java/com/github/dfa/diaspora_android/fragment/CustomFragment.java rename to app/src/main/java/com/github/dfa/diaspora_android/ui/theme/CustomFragment.java index 4283acf6..8f7f26ae 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/fragment/CustomFragment.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/CustomFragment.java @@ -16,7 +16,7 @@ If not, see . */ -package com.github.dfa.diaspora_android.fragment; +package com.github.dfa.diaspora_android.ui.theme; import android.os.Bundle; import android.support.v4.app.Fragment; @@ -30,7 +30,7 @@ import android.view.MenuInflater; public abstract class CustomFragment extends Fragment { - public static final String TAG = "com.github.dfa.diaspora_android.CustomFragment"; + public static final String TAG = "com.github.dfa.diaspora_android.ui.theme.CustomFragment"; /** * We have an optionsMenu diff --git a/app/src/main/java/com/github/dfa/diaspora_android/util/theming/ThemeHelper.java b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemeHelper.java similarity index 92% rename from app/src/main/java/com/github/dfa/diaspora_android/util/theming/ThemeHelper.java rename to app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemeHelper.java index 3f5737f0..64030905 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/util/theming/ThemeHelper.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemeHelper.java @@ -17,7 +17,7 @@ If not, see . This class is inspired by org.horasapps.LeafPic */ -package com.github.dfa.diaspora_android.util.theming; +package com.github.dfa.diaspora_android.ui.theme; import android.content.res.ColorStateList; import android.graphics.Color; @@ -37,7 +37,7 @@ import android.widget.RadioGroup; import android.widget.TextView; import com.github.dfa.diaspora_android.R; -import com.github.dfa.diaspora_android.data.AppSettings; +import com.github.dfa.diaspora_android.util.AppSettings; /** * Singleton that can be used to color views @@ -68,7 +68,7 @@ public class ThemeHelper { public static void updateEditTextColor(EditText editText) { if (editText != null) { editText.setHighlightColor(getInstance().appSettings.getAccentColor()); - if(Build.VERSION.SDK_INT >= 21) { + if (Build.VERSION.SDK_INT >= 21) { editText.getBackground().mutate().setColorFilter(getAccentColor(), PorterDuff.Mode.SRC_ATOP); } } @@ -97,7 +97,7 @@ public class ThemeHelper { } public static void updateTextViewTextColor(TextView textView) { - if(textView != null) { + if (textView != null) { textView.setTextColor(getInstance().appSettings.getAccentColor()); } } @@ -139,12 +139,12 @@ public class ThemeHelper { } public static void updateRadioGroupColor(RadioGroup radioGroup) { - if(radioGroup != null && Build.VERSION.SDK_INT >= 21) { + if (radioGroup != null && Build.VERSION.SDK_INT >= 21) { for (int i = 0; i < radioGroup.getChildCount(); ++i) { RadioButton btn = ((RadioButton) radioGroup.getChildAt(i)); btn.setButtonTintList(new ColorStateList( - new int[][]{ new int[]{-android.R.attr.state_enabled}, new int[]{android.R.attr.state_enabled} }, - new int[] { Color.BLACK ,ThemeHelper.getAccentColor() })); + new int[][]{new int[]{-android.R.attr.state_enabled}, new int[]{android.R.attr.state_enabled}}, + new int[]{Color.BLACK, ThemeHelper.getAccentColor()})); btn.invalidate(); } } diff --git a/app/src/main/java/com/github/dfa/diaspora_android/ui/Themeable.java b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/Themeable.java similarity index 74% rename from app/src/main/java/com/github/dfa/diaspora_android/ui/Themeable.java rename to app/src/main/java/com/github/dfa/diaspora_android/ui/theme/Themeable.java index 8d8db6fe..61ab17fa 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/ui/Themeable.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/Themeable.java @@ -1,4 +1,4 @@ -package com.github.dfa.diaspora_android.ui; +package com.github.dfa.diaspora_android.ui.theme; /** * Interface that allows setting Theme colors diff --git a/app/src/main/java/com/github/dfa/diaspora_android/activity/ThemedActivity.java b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedActivity.java similarity index 93% rename from app/src/main/java/com/github/dfa/diaspora_android/activity/ThemedActivity.java rename to app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedActivity.java index aba3c1c0..c01236c4 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/activity/ThemedActivity.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedActivity.java @@ -16,7 +16,7 @@ If not, see . */ -package com.github.dfa.diaspora_android.activity; +package com.github.dfa.diaspora_android.ui.theme; import android.annotation.TargetApi; import android.app.ActivityManager; @@ -26,8 +26,7 @@ import android.support.v7.app.AppCompatActivity; 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.theming.ThemeHelper; +import com.github.dfa.diaspora_android.util.AppSettings; /** * Activity that supports color schemes diff --git a/app/src/main/java/com/github/dfa/diaspora_android/fragment/ThemedAppCompatDialogFragment.java b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedAppCompatDialogFragment.java similarity index 77% rename from app/src/main/java/com/github/dfa/diaspora_android/fragment/ThemedAppCompatDialogFragment.java rename to app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedAppCompatDialogFragment.java index 632fad22..342026cb 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/fragment/ThemedAppCompatDialogFragment.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedAppCompatDialogFragment.java @@ -1,11 +1,10 @@ -package com.github.dfa.diaspora_android.fragment; +package com.github.dfa.diaspora_android.ui.theme; import android.app.Dialog; import android.os.Bundle; import android.support.v7.app.AppCompatDialogFragment; -import com.github.dfa.diaspora_android.data.AppSettings; -import com.github.dfa.diaspora_android.util.theming.ThemeHelper; +import com.github.dfa.diaspora_android.util.AppSettings; /** * Themed DialogFragment diff --git a/app/src/main/java/com/github/dfa/diaspora_android/ui/ThemedCheckBoxPreference.java b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedCheckBoxPreference.java similarity index 85% rename from app/src/main/java/com/github/dfa/diaspora_android/ui/ThemedCheckBoxPreference.java rename to app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedCheckBoxPreference.java index 40f04946..8da3790a 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/ui/ThemedCheckBoxPreference.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedCheckBoxPreference.java @@ -1,4 +1,4 @@ -package com.github.dfa.diaspora_android.ui; +package com.github.dfa.diaspora_android.ui.theme; import android.content.Context; import android.preference.CheckBoxPreference; @@ -7,9 +7,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.CheckBox; -import com.github.dfa.diaspora_android.R; -import com.github.dfa.diaspora_android.data.AppSettings; -import com.github.dfa.diaspora_android.util.theming.ThemeHelper; +import com.github.dfa.diaspora_android.util.AppSettings; /** * Created by vanitas on 24.10.16. @@ -17,14 +15,17 @@ import com.github.dfa.diaspora_android.util.theming.ThemeHelper; public class ThemedCheckBoxPreference extends CheckBoxPreference implements Themeable { protected View rootLayout; + @SuppressWarnings("unused") public ThemedCheckBoxPreference(Context context) { super(context); } + @SuppressWarnings("unused") public ThemedCheckBoxPreference(Context context, AttributeSet attrs) { super(context, attrs); } + @SuppressWarnings("unused") public ThemedCheckBoxPreference(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); diff --git a/app/src/main/java/com/github/dfa/diaspora_android/ui/ThemedColorPickerPreference.java b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedColorPickerPreference.java similarity index 95% rename from app/src/main/java/com/github/dfa/diaspora_android/ui/ThemedColorPickerPreference.java rename to app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedColorPickerPreference.java index 9ec3efa0..fd5a29de 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/ui/ThemedColorPickerPreference.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedColorPickerPreference.java @@ -1,4 +1,4 @@ -package com.github.dfa.diaspora_android.ui; +package com.github.dfa.diaspora_android.ui.theme; import android.content.Context; import android.graphics.PorterDuff; @@ -9,7 +9,7 @@ import android.view.View; import android.widget.ImageView; import com.github.dfa.diaspora_android.R; -import com.github.dfa.diaspora_android.data.AppSettings; +import com.github.dfa.diaspora_android.util.AppSettings; import com.github.dfa.diaspora_android.util.Helpers; /** diff --git a/app/src/main/java/com/github/dfa/diaspora_android/fragment/ThemedFragment.java b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedFragment.java similarity index 88% rename from app/src/main/java/com/github/dfa/diaspora_android/fragment/ThemedFragment.java rename to app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedFragment.java index 96c034b0..db71a5f9 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/fragment/ThemedFragment.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedFragment.java @@ -16,11 +16,10 @@ If not, see . */ -package com.github.dfa.diaspora_android.fragment; +package com.github.dfa.diaspora_android.ui.theme; import com.github.dfa.diaspora_android.App; -import com.github.dfa.diaspora_android.data.AppSettings; -import com.github.dfa.diaspora_android.util.theming.ThemeHelper; +import com.github.dfa.diaspora_android.util.AppSettings; /** * Fragment that supports color schemes diff --git a/app/src/main/java/com/github/dfa/diaspora_android/ui/ThemedPreferenceCategory.java b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedPreferenceCategory.java similarity index 86% rename from app/src/main/java/com/github/dfa/diaspora_android/ui/ThemedPreferenceCategory.java rename to app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedPreferenceCategory.java index 4ec8cb04..ca9857e2 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/ui/ThemedPreferenceCategory.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedPreferenceCategory.java @@ -1,4 +1,4 @@ -package com.github.dfa.diaspora_android.ui; +package com.github.dfa.diaspora_android.ui.theme; import android.content.Context; import android.preference.PreferenceCategory; @@ -7,8 +7,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.TextView; -import com.github.dfa.diaspora_android.data.AppSettings; -import com.github.dfa.diaspora_android.util.theming.ThemeHelper; +import com.github.dfa.diaspora_android.util.AppSettings; /** * PreferenceCategory with a colored title @@ -17,14 +16,17 @@ import com.github.dfa.diaspora_android.util.theming.ThemeHelper; public class ThemedPreferenceCategory extends PreferenceCategory implements Themeable { protected TextView titleTextView; + @SuppressWarnings("unused") public ThemedPreferenceCategory(Context context) { super(context); } + @SuppressWarnings("unused") public ThemedPreferenceCategory(Context context, AttributeSet attrs) { super(context, attrs); } + @SuppressWarnings("unused") public ThemedPreferenceCategory(Context context, AttributeSet attrs, int defStyle) { @@ -41,7 +43,7 @@ public class ThemedPreferenceCategory extends PreferenceCategory implements Them @Override public void setColors() { - if(titleTextView != null) { + if (titleTextView != null) { ThemeHelper.getInstance(new AppSettings(getContext())); ThemeHelper.updateTextViewTextColor(titleTextView); } diff --git a/app/src/main/java/com/github/dfa/diaspora_android/fragment/ThemedPreferenceFragment.java b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedPreferenceFragment.java similarity index 86% rename from app/src/main/java/com/github/dfa/diaspora_android/fragment/ThemedPreferenceFragment.java rename to app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedPreferenceFragment.java index dd348abb..aae5f0dc 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/fragment/ThemedPreferenceFragment.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedPreferenceFragment.java @@ -1,4 +1,4 @@ -package com.github.dfa.diaspora_android.fragment; +package com.github.dfa.diaspora_android.ui.theme; import android.os.Build; import android.preference.Preference; @@ -7,8 +7,7 @@ import android.preference.PreferenceScreen; import android.view.Window; import com.github.dfa.diaspora_android.App; -import com.github.dfa.diaspora_android.data.AppSettings; -import com.github.dfa.diaspora_android.util.theming.ThemeHelper; +import com.github.dfa.diaspora_android.util.AppSettings; /** * Created by vanitas on 24.10.16. @@ -16,6 +15,7 @@ import com.github.dfa.diaspora_android.util.theming.ThemeHelper; public abstract class ThemedPreferenceFragment extends PreferenceFragment { public abstract void updateViewColors(); + @Override public void onResume() { super.onResume(); @@ -24,7 +24,7 @@ public abstract class ThemedPreferenceFragment extends PreferenceFragment { @Override public boolean onPreferenceTreeClick(PreferenceScreen screen, Preference preference) { - if(isAdded()) { + if (isAdded()) { App app = ((App) getActivity().getApplication()); AppSettings appSettings = app.getSettings(); if (Build.VERSION.SDK_INT >= 21) { diff --git a/app/src/main/java/com/github/dfa/diaspora_android/ui/ThemedVisibilityPreference.java b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedVisibilityPreference.java similarity index 86% rename from app/src/main/java/com/github/dfa/diaspora_android/ui/ThemedVisibilityPreference.java rename to app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedVisibilityPreference.java index ae1cb482..918b2641 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/ui/ThemedVisibilityPreference.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/ThemedVisibilityPreference.java @@ -1,12 +1,11 @@ -package com.github.dfa.diaspora_android.ui; +package com.github.dfa.diaspora_android.ui.theme; import android.content.Context; import android.util.AttributeSet; import android.widget.CheckBox; import com.github.dfa.diaspora_android.R; -import com.github.dfa.diaspora_android.data.AppSettings; -import com.github.dfa.diaspora_android.util.theming.ThemeHelper; +import com.github.dfa.diaspora_android.util.AppSettings; /** * ThemedCheckBoxPreference with visibility icons instead of checkbox. TODO: Make more flexible? diff --git a/app/src/main/java/com/github/dfa/diaspora_android/util/AppLog.java b/app/src/main/java/com/github/dfa/diaspora_android/util/AppLog.java index 178cd008..8f3df81b 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/util/AppLog.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/util/AppLog.java @@ -18,6 +18,12 @@ */ package com.github.dfa.diaspora_android.util; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.Observable; +import java.util.Observer; + /** * Created by gregor on 18.09.16. */ @@ -86,4 +92,126 @@ public class AppLog { Log.v(getLogPrefix(source), _text); } } + + + /** + * Class that saves logs eg. for later debugging. + * TODO: Differentiate log types (error/debug/info...) + */ + public static class Log extends Observable { + public static final int MAX_BUFFER_SIZE = 100; + + public static Log instance; + private AppSettings appSettings; + private SimpleDateFormat dateFormat; + private ArrayList logBuffer; + private ArrayList observers; + + private Log() { + this(null); + } + + private Log(AppSettings appSettings) { + if (appSettings != null) { + //TODO: Store/Restore logBuffer between app starts + logBuffer = new ArrayList<>(); + } else { + logBuffer = new ArrayList<>(); + } + dateFormat = new SimpleDateFormat("HH:mm:ss"); + observers = new ArrayList<>(); + } + + public static Log getInstance() { + if (instance == null) instance = new Log(); + return instance; + } + + public static Log getInstance(AppSettings appSettings) { + if (instance == null) instance = new Log(appSettings); + return instance; + } + + private static String time() { + return getInstance().dateFormat.format(new Date()) + ": "; + } + + public static void d(String tag, String msg) { + Log l = getInstance(); + android.util.Log.d(tag, msg); + l.addLogEntry(msg); + l.notifyLogBufferChanged(); + } + + public static void e(String tag, String msg) { + Log l = getInstance(); + android.util.Log.e(tag, msg); + l.addLogEntry(msg); + l.notifyLogBufferChanged(); + } + + public static void i(String tag, String msg) { + Log l = getInstance(); + android.util.Log.i(tag, msg); + l.addLogEntry(msg); + l.notifyLogBufferChanged(); + } + + public static void v(String tag, String msg) { + Log l = getInstance(); + android.util.Log.v(tag, msg); + l.addLogEntry(msg); + l.notifyLogBufferChanged(); + } + + public static void w(String tag, String msg) { + Log l = getInstance(); + android.util.Log.w(tag, msg); + l.addLogEntry(msg); + l.notifyLogBufferChanged(); + } + + public static void wtf(String tag, String msg) { + Log l = getInstance(); + android.util.Log.wtf(tag, msg); + l.addLogEntry(msg); + l.notifyLogBufferChanged(); + } + + public synchronized static ArrayList getLogBufferArray() { + return getInstance().logBuffer; + } + + public synchronized static String getLogBuffer() { + String out = ""; + for (String s : getInstance().logBuffer) { + out = out + s + "\n"; + } + return out; + } + + private void notifyLogBufferChanged() { + if (observers == null) return; + for (Observer o : observers) { + if (o != null) { + o.update(this, null); + } + } + } + + private synchronized void addLogEntry(String msg) { + logBuffer.add(time() + msg); + while (logBuffer.size() > MAX_BUFFER_SIZE) { + logBuffer.remove(0); + } + } + + public static void addLogObserver(Observer observer) { + getInstance().observers.add(observer); + } + + public static void removeLogObserver(Observer o) { + getInstance().observers.remove(o); + } + } } diff --git a/app/src/main/java/com/github/dfa/diaspora_android/data/AppSettings.java b/app/src/main/java/com/github/dfa/diaspora_android/util/AppSettings.java similarity index 97% rename from app/src/main/java/com/github/dfa/diaspora_android/data/AppSettings.java rename to app/src/main/java/com/github/dfa/diaspora_android/util/AppSettings.java index f8b83da0..668ee668 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/data/AppSettings.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/util/AppSettings.java @@ -12,7 +12,7 @@ along with the Diaspora for Android. If not, see . */ -package com.github.dfa.diaspora_android.data; +package com.github.dfa.diaspora_android.util; import android.annotation.SuppressLint; import android.content.Context; @@ -21,7 +21,8 @@ import android.content.SharedPreferences; import com.github.dfa.diaspora_android.R; import com.github.dfa.diaspora_android.data.DiasporaPodList.DiasporaPod; import com.github.dfa.diaspora_android.data.DiasporaPodList.DiasporaPod.DiasporaPodUrl; -import com.github.dfa.diaspora_android.util.ProxyHandler; +import com.github.dfa.diaspora_android.data.DiasporaAspect; +import com.github.dfa.diaspora_android.web.ProxyHandler; import org.json.JSONException; import org.json.JSONObject; @@ -56,11 +57,11 @@ public class AppSettings { prefApp.edit().clear().apply(); } - public String getKey(int stringKeyRessourceId){ + public String getKey(int stringKeyRessourceId) { return context.getString(stringKeyRessourceId); } - public boolean isKeyEqual(String key, int stringKeyRessourceId){ + public boolean isKeyEqual(String key, int stringKeyRessourceId) { return key.equals(getKey(stringKeyRessourceId)); } @@ -195,15 +196,15 @@ public class AppSettings { return !getString(prefPod, R.string.pref_key__current_pod_0, "").equals(""); } - public void setPodAspects(PodAspect[] aspects) { + public void setPodAspects(DiasporaAspect[] aspects) { setStringArray(prefPod, R.string.pref_key__podprofile_aspects, aspects); } - public PodAspect[] getAspects() { + public DiasporaAspect[] getAspects() { String[] s = getStringArray(prefPod, R.string.pref_key__podprofile_aspects); - PodAspect[] aspects = new PodAspect[s.length]; + DiasporaAspect[] aspects = new DiasporaAspect[s.length]; for (int i = 0; i < aspects.length; i++) { - aspects[i] = new PodAspect(s[i]); + aspects[i] = new DiasporaAspect(s[i]); } return aspects; } diff --git a/app/src/main/java/com/github/dfa/diaspora_android/util/DiasporaUrlHelper.java b/app/src/main/java/com/github/dfa/diaspora_android/util/DiasporaUrlHelper.java index 1377b2a6..10edd275 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/util/DiasporaUrlHelper.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/util/DiasporaUrlHelper.java @@ -20,9 +20,8 @@ package com.github.dfa.diaspora_android.util; 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.data.DiasporaPodList.DiasporaPod; -import com.github.dfa.diaspora_android.data.PodAspect; +import com.github.dfa.diaspora_android.data.DiasporaAspect; /** * Helper class that provides easy access to specific urls related to diaspora @@ -151,7 +150,7 @@ public class DiasporaUrlHelper { * @param aspectId ID of the aspect * @return https://(pod-domain.tld)//aspects?a_ids[]=aspectId */ - public String getAspectUrl(String aspectId) { + public String getAspectUrl(String aspectId) { return getPodUrl() + SUBURL_ASPECT + aspectId; } @@ -315,7 +314,7 @@ public class DiasporaUrlHelper { url = url.replace(getPodUrl() + "/aspects?a_ids[]=", "").split(",")[0]; try { int id = Integer.parseInt(url); - for (PodAspect aspect : app.getPodUserProfile().getAspects()) { + for (DiasporaAspect aspect : app.getDiasporaUserProfile().getAspects()) { if (aspect.id == id) { return aspect.name; } diff --git a/app/src/main/java/com/github/dfa/diaspora_android/util/Helpers.java b/app/src/main/java/com/github/dfa/diaspora_android/util/Helpers.java index 68b10dca..5db1e5d2 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/util/Helpers.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/util/Helpers.java @@ -30,6 +30,7 @@ import android.support.design.widget.Snackbar; import android.view.View; import com.github.dfa.diaspora_android.R; +import com.github.dfa.diaspora_android.web.WebHelper; import java.io.BufferedReader; import java.io.File; diff --git a/app/src/main/java/com/github/dfa/diaspora_android/util/Log.java b/app/src/main/java/com/github/dfa/diaspora_android/util/Log.java deleted file mode 100644 index 2cca9acf..00000000 --- a/app/src/main/java/com/github/dfa/diaspora_android/util/Log.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - This file is part of the Diaspora for Android. - - Diaspora for Android is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Diaspora for Android is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with the Diaspora for Android. - - If not, see . - */ -package com.github.dfa.diaspora_android.util; - -import com.github.dfa.diaspora_android.data.AppSettings; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.Observable; -import java.util.Observer; - -/** - * Class that saves logs eg. for later debugging. - * TODO: Differentiate log types (error/debug/info...) - * Created by vanitas on 09.09.16. - */ -public class Log extends Observable { - public static final int MAX_BUFFER_SIZE = 100; - - public static Log instance; - private AppSettings appSettings; - private SimpleDateFormat dateFormat; - private ArrayList logBuffer; - private ArrayList observers; - - private Log() { - this(null); - } - - private Log(AppSettings appSettings) { - if (appSettings != null) { - //TODO: Store/Restore logBuffer between app starts - logBuffer = new ArrayList<>(); - } else { - logBuffer = new ArrayList<>(); - } - dateFormat = new SimpleDateFormat("HH:mm:ss"); - observers = new ArrayList<>(); - } - - public static Log getInstance() { - if (instance == null) instance = new Log(); - return instance; - } - - public static Log getInstance(AppSettings appSettings) { - if (instance == null) instance = new Log(appSettings); - return instance; - } - - private static String time() { - return getInstance().dateFormat.format(new Date()) + ": "; - } - - public static void d(String tag, String msg) { - Log l = getInstance(); - android.util.Log.d(tag, msg); - l.addLogEntry(msg); - l.notifyLogBufferChanged(); - } - - public static void e(String tag, String msg) { - Log l = getInstance(); - android.util.Log.e(tag, msg); - l.addLogEntry(msg); - l.notifyLogBufferChanged(); - } - - public static void i(String tag, String msg) { - Log l = getInstance(); - android.util.Log.i(tag, msg); - l.addLogEntry(msg); - l.notifyLogBufferChanged(); - } - - public static void v(String tag, String msg) { - Log l = getInstance(); - android.util.Log.v(tag, msg); - l.addLogEntry(msg); - l.notifyLogBufferChanged(); - } - - public static void w(String tag, String msg) { - Log l = getInstance(); - android.util.Log.w(tag, msg); - l.addLogEntry(msg); - l.notifyLogBufferChanged(); - } - - public static void wtf(String tag, String msg) { - Log l = getInstance(); - android.util.Log.wtf(tag, msg); - l.addLogEntry(msg); - l.notifyLogBufferChanged(); - } - - public synchronized static ArrayList getLogBufferArray() { - return getInstance().logBuffer; - } - - public synchronized static String getLogBuffer() { - String out = ""; - for (String s : getInstance().logBuffer) { - out = out + s + "\n"; - } - return out; - } - - private void notifyLogBufferChanged() { - if (observers == null) return; - for (Observer o : observers) { - if (o != null) { - o.update(this, null); - } - } - } - - private synchronized void addLogEntry(String msg) { - logBuffer.add(time() + msg); - while (logBuffer.size() > MAX_BUFFER_SIZE) { - logBuffer.remove(0); - } - } - - public static void addLogObserver(Observer observer) { - getInstance().observers.add(observer); - } - - public static void removeLogObserver(Observer o) { - getInstance().observers.remove(o); - } -} diff --git a/app/src/main/java/com/github/dfa/diaspora_android/fragment/BrowserFragment.java b/app/src/main/java/com/github/dfa/diaspora_android/web/BrowserFragment.java similarity index 96% rename from app/src/main/java/com/github/dfa/diaspora_android/fragment/BrowserFragment.java rename to app/src/main/java/com/github/dfa/diaspora_android/web/BrowserFragment.java index 7905bc6b..0460e428 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/fragment/BrowserFragment.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/web/BrowserFragment.java @@ -16,7 +16,7 @@ If not, see . */ -package com.github.dfa.diaspora_android.fragment; +package com.github.dfa.diaspora_android.web; import android.Manifest; import android.content.DialogInterface; @@ -40,13 +40,10 @@ import android.widget.ProgressBar; 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.ui.ContextMenuWebView; +import com.github.dfa.diaspora_android.ui.theme.ThemeHelper; +import com.github.dfa.diaspora_android.ui.theme.ThemedFragment; import com.github.dfa.diaspora_android.util.AppLog; -import com.github.dfa.diaspora_android.util.ProxyHandler; -import com.github.dfa.diaspora_android.util.theming.ThemeHelper; -import com.github.dfa.diaspora_android.webview.CustomWebViewClient; -import com.github.dfa.diaspora_android.webview.ProgressBarWebChromeClient; +import com.github.dfa.diaspora_android.util.AppSettings; import java.io.File; import java.io.FileOutputStream; diff --git a/app/src/main/java/com/github/dfa/diaspora_android/ui/ContextMenuWebView.java b/app/src/main/java/com/github/dfa/diaspora_android/web/ContextMenuWebView.java similarity index 99% rename from app/src/main/java/com/github/dfa/diaspora_android/ui/ContextMenuWebView.java rename to app/src/main/java/com/github/dfa/diaspora_android/web/ContextMenuWebView.java index 6f7ba003..39f3d4bc 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/ui/ContextMenuWebView.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/web/ContextMenuWebView.java @@ -16,7 +16,7 @@ If not, see . */ -package com.github.dfa.diaspora_android.ui; +package com.github.dfa.diaspora_android.web; import android.Manifest; import android.app.Activity; @@ -39,7 +39,7 @@ import android.widget.Toast; import com.github.dfa.diaspora_android.R; import com.github.dfa.diaspora_android.activity.MainActivity; -import com.github.dfa.diaspora_android.task.ImageDownloadTask; +import com.github.dfa.diaspora_android.service.ImageDownloadTask; import java.io.File; diff --git a/app/src/main/java/com/github/dfa/diaspora_android/webview/CustomWebViewClient.java b/app/src/main/java/com/github/dfa/diaspora_android/web/CustomWebViewClient.java similarity index 98% rename from app/src/main/java/com/github/dfa/diaspora_android/webview/CustomWebViewClient.java rename to app/src/main/java/com/github/dfa/diaspora_android/web/CustomWebViewClient.java index beb85d19..20afcd07 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/webview/CustomWebViewClient.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/web/CustomWebViewClient.java @@ -16,7 +16,7 @@ If not, see . */ -package com.github.dfa.diaspora_android.webview; +package com.github.dfa.diaspora_android.web; import android.content.Intent; import android.support.v4.content.LocalBroadcastManager; diff --git a/app/src/main/java/com/github/dfa/diaspora_android/webview/DiasporaStreamWebChromeClient.java b/app/src/main/java/com/github/dfa/diaspora_android/web/DiasporaStreamWebChromeClient.java similarity index 95% rename from app/src/main/java/com/github/dfa/diaspora_android/webview/DiasporaStreamWebChromeClient.java rename to app/src/main/java/com/github/dfa/diaspora_android/web/DiasporaStreamWebChromeClient.java index 759fc317..1438f447 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/webview/DiasporaStreamWebChromeClient.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/web/DiasporaStreamWebChromeClient.java @@ -16,13 +16,12 @@ If not, see . */ -package com.github.dfa.diaspora_android.webview; +package com.github.dfa.diaspora_android.web; import android.webkit.WebView; import android.widget.ProgressBar; import com.github.dfa.diaspora_android.util.AppLog; -import com.github.dfa.diaspora_android.util.WebHelper; /** * Created by vanitas on 26.09.16. diff --git a/app/src/main/java/com/github/dfa/diaspora_android/webview/FileUploadWebChromeClient.java b/app/src/main/java/com/github/dfa/diaspora_android/web/FileUploadWebChromeClient.java similarity index 97% rename from app/src/main/java/com/github/dfa/diaspora_android/webview/FileUploadWebChromeClient.java rename to app/src/main/java/com/github/dfa/diaspora_android/web/FileUploadWebChromeClient.java index 5e714211..b1a6ce48 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/webview/FileUploadWebChromeClient.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/web/FileUploadWebChromeClient.java @@ -16,7 +16,7 @@ If not, see . */ -package com.github.dfa.diaspora_android.webview; +package com.github.dfa.diaspora_android.web; import android.net.Uri; import android.webkit.ValueCallback; diff --git a/app/src/main/java/com/github/dfa/diaspora_android/ui/NestedWebView.java b/app/src/main/java/com/github/dfa/diaspora_android/web/NestedWebView.java similarity index 99% rename from app/src/main/java/com/github/dfa/diaspora_android/ui/NestedWebView.java rename to app/src/main/java/com/github/dfa/diaspora_android/web/NestedWebView.java index 4f59a339..d714d757 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/ui/NestedWebView.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/web/NestedWebView.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.github.dfa.diaspora_android.ui; +package com.github.dfa.diaspora_android.web; import android.content.Context; import android.support.v4.view.MotionEventCompat; diff --git a/app/src/main/java/com/github/dfa/diaspora_android/webview/ProgressBarWebChromeClient.java b/app/src/main/java/com/github/dfa/diaspora_android/web/ProgressBarWebChromeClient.java similarity index 96% rename from app/src/main/java/com/github/dfa/diaspora_android/webview/ProgressBarWebChromeClient.java rename to app/src/main/java/com/github/dfa/diaspora_android/web/ProgressBarWebChromeClient.java index ec5c7b41..cbfc68b6 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/webview/ProgressBarWebChromeClient.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/web/ProgressBarWebChromeClient.java @@ -16,7 +16,7 @@ If not, see . */ -package com.github.dfa.diaspora_android.webview; +package com.github.dfa.diaspora_android.web; import android.view.View; import android.webkit.WebChromeClient; diff --git a/app/src/main/java/com/github/dfa/diaspora_android/util/ProxyHandler.java b/app/src/main/java/com/github/dfa/diaspora_android/web/ProxyHandler.java similarity index 96% rename from app/src/main/java/com/github/dfa/diaspora_android/util/ProxyHandler.java rename to app/src/main/java/com/github/dfa/diaspora_android/web/ProxyHandler.java index 160d36ad..8ec2aad4 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/util/ProxyHandler.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/web/ProxyHandler.java @@ -16,14 +16,15 @@ If not, see . */ -package com.github.dfa.diaspora_android.util; +package com.github.dfa.diaspora_android.web; import android.content.Context; import android.os.StrictMode; import android.webkit.WebView; 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.AppSettings; import java.util.ArrayList; diff --git a/app/src/main/java/com/github/dfa/diaspora_android/util/WebHelper.java b/app/src/main/java/com/github/dfa/diaspora_android/web/WebHelper.java similarity index 99% rename from app/src/main/java/com/github/dfa/diaspora_android/util/WebHelper.java rename to app/src/main/java/com/github/dfa/diaspora_android/web/WebHelper.java index 8d9dd44f..a82df182 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/util/WebHelper.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/web/WebHelper.java @@ -17,7 +17,7 @@ If not, see . */ -package com.github.dfa.diaspora_android.util; +package com.github.dfa.diaspora_android.web; import android.content.Context; import android.net.ConnectivityManager; diff --git a/app/src/main/java/com/github/dfa/diaspora_android/util/CustomTabHelpers/BrowserFallback.java b/app/src/main/java/com/github/dfa/diaspora_android/web/custom_tab/BrowserFallback.java similarity index 95% rename from app/src/main/java/com/github/dfa/diaspora_android/util/CustomTabHelpers/BrowserFallback.java rename to app/src/main/java/com/github/dfa/diaspora_android/web/custom_tab/BrowserFallback.java index 4e70f1c0..44623ccd 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/util/CustomTabHelpers/BrowserFallback.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/web/custom_tab/BrowserFallback.java @@ -16,7 +16,7 @@ If not, see . */ -package com.github.dfa.diaspora_android.util.CustomTabHelpers; +package com.github.dfa.diaspora_android.web.custom_tab; import android.app.Activity; import android.content.Intent; diff --git a/app/src/main/java/com/github/dfa/diaspora_android/util/CustomTabHelpers/CustomTabActivityHelper.java b/app/src/main/java/com/github/dfa/diaspora_android/web/custom_tab/CustomTabActivityHelper.java similarity index 98% rename from app/src/main/java/com/github/dfa/diaspora_android/util/CustomTabHelpers/CustomTabActivityHelper.java rename to app/src/main/java/com/github/dfa/diaspora_android/web/custom_tab/CustomTabActivityHelper.java index 0429b44b..3af91173 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/util/CustomTabHelpers/CustomTabActivityHelper.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/web/custom_tab/CustomTabActivityHelper.java @@ -16,7 +16,7 @@ If not, see . */ -package com.github.dfa.diaspora_android.util.CustomTabHelpers; +package com.github.dfa.diaspora_android.web.custom_tab; import android.app.Activity; import android.content.ComponentName; diff --git a/app/src/main/java/com/github/dfa/diaspora_android/util/CustomTabHelpers/CustomTabsHelper.java b/app/src/main/java/com/github/dfa/diaspora_android/web/custom_tab/CustomTabsHelper.java similarity index 98% rename from app/src/main/java/com/github/dfa/diaspora_android/util/CustomTabHelpers/CustomTabsHelper.java rename to app/src/main/java/com/github/dfa/diaspora_android/web/custom_tab/CustomTabsHelper.java index 1aa6713f..99d8cf10 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/util/CustomTabHelpers/CustomTabsHelper.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/web/custom_tab/CustomTabsHelper.java @@ -16,7 +16,7 @@ If not, see . */ -package com.github.dfa.diaspora_android.util.CustomTabHelpers; +package com.github.dfa.diaspora_android.web.custom_tab; import android.content.Context; import android.content.Intent; diff --git a/app/src/main/res/drawable-hdpi/ic_launcher.png b/app/src/main/res/drawable-hdpi/ic_launcher.png index 11f95124..4e38e5c2 100644 Binary files a/app/src/main/res/drawable-hdpi/ic_launcher.png and b/app/src/main/res/drawable-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_launcher.png b/app/src/main/res/drawable-mdpi/ic_launcher.png index b356e40a..375b47d7 100644 Binary files a/app/src/main/res/drawable-mdpi/ic_launcher.png and b/app/src/main/res/drawable-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_launcher.png b/app/src/main/res/drawable-xhdpi/ic_launcher.png index 5055f6cf..16dc7a29 100644 Binary files a/app/src/main/res/drawable-xhdpi/ic_launcher.png and b/app/src/main/res/drawable-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_launcher.png b/app/src/main/res/drawable-xxhdpi/ic_launcher.png index 2001d858..80bb0633 100644 Binary files a/app/src/main/res/drawable-xxhdpi/ic_launcher.png and b/app/src/main/res/drawable-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_launcher.png b/app/src/main/res/drawable-xxxhdpi/ic_launcher.png index 0d77fa66..bdde0721 100644 Binary files a/app/src/main/res/drawable-xxxhdpi/ic_launcher.png and b/app/src/main/res/drawable-xxxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/layout/browser__fragment.xml b/app/src/main/res/layout/browser__fragment.xml index 9a6c941d..943443e7 100644 --- a/app/src/main/res/layout/browser__fragment.xml +++ b/app/src/main/res/layout/browser__fragment.xml @@ -3,7 +3,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - diff --git a/app/src/main/res/layout/recycler_view__list_item.xml b/app/src/main/res/layout/recycler_list__list_item_with_fav.xml similarity index 100% rename from app/src/main/res/layout/recycler_view__list_item.xml rename to app/src/main/res/layout/recycler_list__list_item_with_fav.xml index 0fa5e8c2..e72fdbdf 100644 --- a/app/src/main/res/layout/recycler_view__list_item.xml +++ b/app/src/main/res/layout/recycler_list__list_item_with_fav.xml @@ -1,7 +1,7 @@ + android:title="@string/action_search_by_tags_or_persons" + app:showAsAction="always" /> + android:title="@string/action_compose_new_post" + app:showAsAction="always" /> + android:title="@string/action_go_to_top" + app:showAsAction="always" /> + app:showAsAction="never" /> diff --git a/app/src/main/res/menu/main__menu_top.xml b/app/src/main/res/menu/main__menu_top.xml index 71750e4f..d778143b 100644 --- a/app/src/main/res/menu/main__menu_top.xml +++ b/app/src/main/res/menu/main__menu_top.xml @@ -8,7 +8,7 @@ android:icon="@drawable/ic_notifications_white_48px__layer" android:orderInCategory="100" android:title="@string/notifications" - app:showAsAction="always"/> + app:showAsAction="always" /> - + + android:visible="false" /> diff --git a/app/src/main/res/menu/stream__menu_bottom.xml b/app/src/main/res/menu/stream__menu_bottom.xml index f93e1b19..c46b9203 100644 --- a/app/src/main/res/menu/stream__menu_bottom.xml +++ b/app/src/main/res/menu/stream__menu_bottom.xml @@ -4,13 +4,19 @@ + android:title="@string/action_share_dotdotdot" + app:showAsAction="always"> - - - + + + diff --git a/app/src/main/res/menu/stream__menu_top.xml b/app/src/main/res/menu/stream__menu_top.xml index 9d948098..fe316b97 100644 --- a/app/src/main/res/menu/stream__menu_top.xml +++ b/app/src/main/res/menu/stream__menu_top.xml @@ -5,8 +5,8 @@ + android:title="@string/reload" + app:showAsAction="always" /> \ No newline at end of file diff --git a/app/src/main/res/raw/podlist.json b/app/src/main/res/raw/podlist.json index 6d5ae23d..83fd7c89 100644 --- a/app/src/main/res/raw/podlist.json +++ b/app/src/main/res/raw/podlist.json @@ -1,7 +1,7 @@ { "pods": [ { - "active6": 12442, + "active6": 12476, "score": 20, "podUrls": [ {"host": "joindiaspora.com"}, @@ -16,7 +16,7 @@ "id": 38077 }, { - "active6": 7170, + "active6": 7155, "score": 20, "podUrls": [{"host": "pod.geraspora.de"}], "name": "Geraspora", @@ -24,7 +24,7 @@ "id": 24783 }, { - "active6": 3726, + "active6": 3723, "score": 20, "podUrls": [{"host": "diasp.org"}], "name": "diasporg*", @@ -32,7 +32,7 @@ "id": 12688 }, { - "active6": 10298, + "active6": 10321, "score": 20, "podUrls": [{"host": "framasphere.org"}], "name": "Framasphere", @@ -48,7 +48,7 @@ "id": 17343 }, { - "active6": 853, + "active6": 854, "score": 20, "podUrls": [{"host": "despora.de"}], "name": "Despora*", @@ -95,7 +95,7 @@ "id": 38327 }, { - "active6": 47, + "active6": 48, "score": 20, "podUrls": [{"host": "canfly.org"}], "name": "canfly.org", @@ -119,7 +119,7 @@ "id": 46568 }, { - "active6": 72, + "active6": 73, "score": 20, "podUrls": [{"host": "d.consumium.org"}], "name": "d.consumium.org", @@ -199,7 +199,7 @@ "id": 4343 }, { - "active6": 196, + "active6": 179, "score": 20, "podUrls": [{"host": "diasp.nl"}], "name": "diasp.nl", @@ -207,7 +207,7 @@ "id": 33262 }, { - "active6": 185, + "active6": 177, "score": 20, "podUrls": [{"host": "diaspod.de"}], "name": "diaspod.de", @@ -375,7 +375,7 @@ "id": 9863 }, { - "active6": 257, + "active6": 256, "score": 20, "podUrls": [{"host": "diaspora.permutationsofchaos.com"}], "name": "permutationsofchaos.com", @@ -479,7 +479,7 @@ "id": 39183 }, { - "active6": 36, + "active6": 37, "score": 20, "podUrls": [{"host": "diaspora.subsignal.org"}], "name": "subsignal.org", @@ -495,7 +495,7 @@ "id": 46672 }, { - "active6": 35, + "active6": 37, "score": 20, "podUrls": [{"host": "diaspora.u4u.org"}], "name": "u4u.org", @@ -535,7 +535,7 @@ "id": 27412 }, { - "active6": 1169, + "active6": 1168, "score": 20, "podUrls": [{"host": "diasporabr.com.br"}], "name": "diasporabr.com.br", @@ -543,7 +543,7 @@ "id": 18248 }, { - "active6": 365, + "active6": 364, "score": 20, "podUrls": [{"host": "diasporabrazil.org"}], "name": "diasporabrazil.org", @@ -559,8 +559,8 @@ "id": 27962 }, { - "active6": 0, - "score": 0, + "active6": 7, + "score": 20, "podUrls": [{"host": "diasporapr.tk"}], "name": "diasporapr.tk", "mainLangs": [], @@ -575,7 +575,7 @@ "id": 46740 }, { - "active6": 29, + "active6": 30, "score": 20, "podUrls": [{"host": "diasporing.ch"}], "name": "Diasporing.ch", @@ -639,7 +639,7 @@ "id": 41690 }, { - "active6": 168, + "active6": 169, "score": 20, "podUrls": [{"host": "flokk.no"}], "name": "flokk.no", @@ -671,7 +671,7 @@ "id": 13758 }, { - "active6": 73, + "active6": 72, "score": 20, "podUrls": [{"host": "idoru.pl"}], "name": "idoru.pl", @@ -727,7 +727,7 @@ "id": 32393 }, { - "active6": 140, + "active6": 139, "score": 20, "podUrls": [{"host": "liberdade.digital"}], "name": "liberdade.digital", @@ -775,7 +775,7 @@ "id": 16366 }, { - "active6": 616, + "active6": 614, "score": 20, "podUrls": [{"host": "mondiaspora.net"}], "name": "mondiaspora.net", @@ -959,7 +959,7 @@ "id": 36615 }, { - "active6": 57, + "active6": 56, "score": 20, "podUrls": [{"host": "pod.hashtagueule.fr"}], "name": "hashtagueule.fr", @@ -1031,7 +1031,7 @@ "id": 9248 }, { - "active6": 98, + "active6": 99, "score": 20, "podUrls": [{"host": "pod.nomorestars.com"}], "name": "nomorestars.com", @@ -1039,7 +1039,7 @@ "id": 31958 }, { - "active6": 404, + "active6": 405, "score": 20, "podUrls": [{"host": "pod.orkz.net"}], "name": "orkz.net", @@ -1048,7 +1048,7 @@ }, { "active6": 37, - "score": 20, + "score": -1, "podUrls": [{"host": "pod.ponk.pink"}], "name": "ponk.pink", "mainLangs": [], @@ -1063,8 +1063,8 @@ "id": 21338 }, { - "active6": 86, - "score": 20, + "active6": 85, + "score": 11, "podUrls": [{"host": "pod.psynet.su"}], "name": "psynet.su", "mainLangs": [], @@ -1135,7 +1135,7 @@ "id": 33181 }, { - "active6": 73, + "active6": 74, "score": 20, "podUrls": [{"host": "pod.tchncs.de"}], "name": "tchncs.de", @@ -1175,7 +1175,7 @@ "id": 16270 }, { - "active6": 386, + "active6": 392, "score": 20, "podUrls": [{"host": "poddery.com"}], "name": "poddery.com", @@ -1215,7 +1215,7 @@ "id": 41788 }, { - "active6": 100, + "active6": 101, "score": 20, "podUrls": [{"host": "ruhrspora.de"}], "name": "ruhrspora.de", @@ -1263,7 +1263,7 @@ "id": 37517 }, { - "active6": 84, + "active6": 85, "score": 20, "podUrls": [{"host": "social.elaon.de"}], "name": "elaon.de", @@ -1319,7 +1319,7 @@ "id": 29359 }, { - "active6": 39, + "active6": 37, "score": 20, "podUrls": [{"host": "sysad.org"}], "name": "sysad.org", @@ -1335,7 +1335,7 @@ "id": 5276 }, { - "active6": 3982, + "active6": 3964, "score": 20, "podUrls": [{"host": "therealtalk.org"}], "name": "therealtalk.org", @@ -1439,7 +1439,7 @@ "id": 33317 }, { - "active6": 11, + "active6": 14, "score": 20, "podUrls": [{"host": "diaspora.zone"}], "name": "zone", @@ -1447,7 +1447,7 @@ "id": 41976 }, { - "active6": 1, + "active6": 2, "score": 20, "podUrls": [{"host": "pod.userzap.de"}], "name": "userzap.de", @@ -1455,5 +1455,5 @@ "id": 12816 } ], - "timestamp": 1477430185319 + "timestamp": 1477491769316 } diff --git a/app/src/main/res/values-cs/strings-about.xml b/app/src/main/res/values-cs/strings-about.xml deleted file mode 100644 index 54191dc5..00000000 --- a/app/src/main/res/values-cs/strings-about.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/app/src/main/res/values-cs/strings-preferences.xml b/app/src/main/res/values-cs/strings-preferences.xml deleted file mode 100644 index 7be06570..00000000 --- a/app/src/main/res/values-cs/strings-preferences.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml deleted file mode 100644 index 69332975..00000000 --- a/app/src/main/res/values-cs/strings.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/app/src/main/res/values-el/strings-about.xml b/app/src/main/res/values-el/strings-about.xml deleted file mode 100644 index 54191dc5..00000000 --- a/app/src/main/res/values-el/strings-about.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/app/src/main/res/values-el/strings-preferences.xml b/app/src/main/res/values-el/strings-preferences.xml deleted file mode 100644 index 7be06570..00000000 --- a/app/src/main/res/values-el/strings-preferences.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml deleted file mode 100644 index 69332975..00000000 --- a/app/src/main/res/values-el/strings.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/app/src/main/res/values-hi/strings-about.xml b/app/src/main/res/values-hi/strings-about.xml deleted file mode 100644 index 54191dc5..00000000 --- a/app/src/main/res/values-hi/strings-about.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/app/src/main/res/values-hi/strings-preferences.xml b/app/src/main/res/values-hi/strings-preferences.xml deleted file mode 100644 index 7be06570..00000000 --- a/app/src/main/res/values-hi/strings-preferences.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml deleted file mode 100644 index 69332975..00000000 --- a/app/src/main/res/values-hi/strings.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/app/src/main/res/values-hu/strings-about.xml b/app/src/main/res/values-hu/strings-about.xml deleted file mode 100644 index 54191dc5..00000000 --- a/app/src/main/res/values-hu/strings-about.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/app/src/main/res/values-hu/strings-preferences.xml b/app/src/main/res/values-hu/strings-preferences.xml deleted file mode 100644 index 7be06570..00000000 --- a/app/src/main/res/values-hu/strings-preferences.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml deleted file mode 100644 index 69332975..00000000 --- a/app/src/main/res/values-hu/strings.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/app/src/main/res/values-nl/strings-about.xml b/app/src/main/res/values-nl/strings-about.xml deleted file mode 100644 index 54191dc5..00000000 --- a/app/src/main/res/values-nl/strings-about.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/app/src/main/res/values-nl/strings-preferences.xml b/app/src/main/res/values-nl/strings-preferences.xml deleted file mode 100644 index f5b9495e..00000000 --- a/app/src/main/res/values-nl/strings-preferences.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - Vormgeving - Netwerk - Pod-instellingen - - - Navigatie Slider - Item Zichtbaarheid - - - - Lettergrootte - - - Afbeeldingen laden - Afbeelding laden uitschakelen om mobiele data te besparen - - Proxy inschakelen - - - Persoonlijke instellingen - Uw lijst met contactpersonen beheren - Beheren van Hashtags - Toevoegen en verwijderen van de hashtags die u volgt - Account wijzigen - Lokale sessiegegevens wissen en schakel over naar een andere Diaspora pod/account - Dit zal alle cookies en sessiegegevens wissen. Wilt u echt uw account wijzigen? - Cache wissen - WebView-cache leegmaken - Boven- en onderkant werkbalken automatisch verbergen tijdens het scrollen - Werkbalken slim wegwerken - Gedeeld-via-aankondiging toevoegen - Een verwijzing naar dit app (\"gedeeld door…\") toevoegen aan gedeelde teksten - - - - diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml deleted file mode 100644 index b27eec67..00000000 --- a/app/src/main/res/values-nl/strings.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - *[gedeeld door #DiasporaForAndroid]* - - Opnieuw Laden - Ongelezen bericht. Wilt u het lezen? - - Instellingen - Meldingen - Gesprekken - Stream - Profiel - Aspecten - Activiteiten - Leuk gevonden - Gereageerd - Vermeldingen - Openbaar - Zoeken - - - Selecteer Pod - Voer pod domein - Bevestigen pod url - Opmerking: De podlijst is gevuld met beveiligde pods vermeld op https://podupti.me. U kunt in het bewerk veld elke pod invullen die niet in de lijst staat. - Voer een geldige domeinnaam in - Fout: Kan niet de podlijst ophalen! - Sorry, u moet verbinding met internet hebben om verder te gaan - Bevestiging - Wilt u echt \nhttps://%1$s\n als uw Diaspora pod gebruiken? - Wilt u afsluiten? - - Gevolgde Tags - Publieke activiteiten - Link delen als tekst - Screenshot van de webpagina delen - Neem screenshot van de webpagina - Afbeelding opslaan - Screenshot oplaan als: - Link adres gekopieerd… - Nieuw Bericht - Terug naar boven - Zoeken op tags of personen - App afsluiten - Desktop weergave in-/uitschakelen - Delen… - viaTags - via mensen - Voeg een naam toe - Deel adreslink - Afbeelding opslaan - Deel afbeelding - Geopend in externe browser… - Link-adres kopiëren naar Klembord - - Waarschuwing: Kan niet netwerk proxy instellen… - Niet in staat om afbeelding te laden - Alle tags - - Toestemming geweigerd. - Toestemming verleend. Probeer het opnieuw. - diff --git a/app/src/main/res/values-no/strings-about.xml b/app/src/main/res/values-no/strings-about.xml deleted file mode 100644 index 54191dc5..00000000 --- a/app/src/main/res/values-no/strings-about.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/app/src/main/res/values-no/strings-preferences.xml b/app/src/main/res/values-no/strings-preferences.xml deleted file mode 100644 index 7be06570..00000000 --- a/app/src/main/res/values-no/strings-preferences.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/values-no/strings.xml b/app/src/main/res/values-no/strings.xml deleted file mode 100644 index 69332975..00000000 --- a/app/src/main/res/values-no/strings.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/app/src/main/res/values-pt/strings-about.xml b/app/src/main/res/values-pt/strings-about.xml deleted file mode 100644 index 54191dc5..00000000 --- a/app/src/main/res/values-pt/strings-about.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/app/src/main/res/values-pt/strings-preferences.xml b/app/src/main/res/values-pt/strings-preferences.xml deleted file mode 100644 index 7be06570..00000000 --- a/app/src/main/res/values-pt/strings-preferences.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml deleted file mode 100644 index 69332975..00000000 --- a/app/src/main/res/values-pt/strings.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/app/src/main/res/values-sv/strings-about.xml b/app/src/main/res/values-sv/strings-about.xml deleted file mode 100644 index 54191dc5..00000000 --- a/app/src/main/res/values-sv/strings-about.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/app/src/main/res/values-sv/strings-preferences.xml b/app/src/main/res/values-sv/strings-preferences.xml deleted file mode 100644 index 7be06570..00000000 --- a/app/src/main/res/values-sv/strings-preferences.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml deleted file mode 100644 index 69332975..00000000 --- a/app/src/main/res/values-sv/strings.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/app/src/main/res/values-tr/strings-about.xml b/app/src/main/res/values-tr/strings-about.xml deleted file mode 100644 index 54191dc5..00000000 --- a/app/src/main/res/values-tr/strings-about.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/app/src/main/res/values-tr/strings-preferences.xml b/app/src/main/res/values-tr/strings-preferences.xml deleted file mode 100644 index 7be06570..00000000 --- a/app/src/main/res/values-tr/strings-preferences.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml deleted file mode 100644 index 69332975..00000000 --- a/app/src/main/res/values-tr/strings.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/app/src/main/res/values/color.xml b/app/src/main/res/values/color.xml index 7f16c9e6..14025f63 100644 --- a/app/src/main/res/values/color.xml +++ b/app/src/main/res/values/color.xml @@ -17,9 +17,12 @@ #ffffff #000000 + #eeeeee + #c4000000 + @color/md_grey_200 - - + #f44336 #e91e63 #9c27b0 @@ -37,7 +40,14 @@ #9e9e9e #000000 - + #000000 #8A000000 @@ -133,7 +143,6 @@ #00B8D4 - #FFCCBC #FFAB91 #FF8A65 @@ -342,6 +351,4 @@ #FFFF00 #FFEA00 #FFD600 - - #c4000000 \ No newline at end of file diff --git a/app/src/main/res/xml/preferences__master.xml b/app/src/main/res/xml/preferences__master.xml index c6354445..b5f0caca 100644 --- a/app/src/main/res/xml/preferences__master.xml +++ b/app/src/main/res/xml/preferences__master.xml @@ -1,7 +1,7 @@ - @@ -23,34 +23,34 @@ android:summary="%s" android:title="@string/pref_title__font_size"/> - - - - - + - - + - - - + - @@ -106,5 +106,5 @@ android:summary="@string/pref_desc__sub_logging" android:title="@string/pref_title__sub_logging" /> - + \ No newline at end of file diff --git a/app/src/main/res/xml/preferences__sub_debugging.xml b/app/src/main/res/xml/preferences__sub_debugging.xml index 91145231..17ca7241 100644 --- a/app/src/main/res/xml/preferences__sub_debugging.xml +++ b/app/src/main/res/xml/preferences__sub_debugging.xml @@ -1,16 +1,16 @@ - - - - + \ No newline at end of file diff --git a/app/src/main/res/xml/preferences__sub_navslider_vis.xml b/app/src/main/res/xml/preferences__sub_navslider_vis.xml index 5a8395b3..0579a6be 100644 --- a/app/src/main/res/xml/preferences__sub_navslider_vis.xml +++ b/app/src/main/res/xml/preferences__sub_navslider_vis.xml @@ -1,54 +1,54 @@ - - - - - - - - - - - - - + \ No newline at end of file diff --git a/app/src/main/res/xml/preferences__sub_proxy.xml b/app/src/main/res/xml/preferences__sub_proxy.xml index 72933d28..ab7b01da 100644 --- a/app/src/main/res/xml/preferences__sub_proxy.xml +++ b/app/src/main/res/xml/preferences__sub_proxy.xml @@ -1,9 +1,9 @@ - - - + diff --git a/app/src/main/res/xml/preferences__sub_themes.xml b/app/src/main/res/xml/preferences__sub_themes.xml index 88e05d59..a4bca2cf 100644 --- a/app/src/main/res/xml/preferences__sub_themes.xml +++ b/app/src/main/res/xml/preferences__sub_themes.xml @@ -1,18 +1,18 @@ - - - - + \ No newline at end of file diff --git a/crowdin.yaml b/crowdin.yaml index e0c205fa..8f50437b 100644 --- a/crowdin.yaml +++ b/crowdin.yaml @@ -4,22 +4,22 @@ files: translation: '/app/src/main/res/values-%android_code%/%original_file_name%' languages_mapping: android_code: - sv-SE: sv - es-ES: es - ml-IN: ml - pt-PT: pt - "no": 'no' - de: de - tr: tr - ca: ca - ru: ru - pl: pl - nl: nl - ja: ja - it: it - hu: hu - hi: hi - fr: fr - el: el - cs: cs - kn: kn + ml-IN: ml # Malayalam + sv-SE: sv # Swedish + es-ES: es # Espanol + de: de # German + ru: ru # Russian + pl: pl # Polish + ja: ja # Japanese + it: it # Italian + fr: fr # French + kn: kn # Kannada (Asian) +# hu: hu # Hungarian +# hi: hi # Hindi +# nl: nl # Dutch +# el: el # Greel +# cs: cs # Czeck +# "no": 'no' # Norwegian +# tr: tr # Turkish +# ca: ca # Catalan +# pt-PT: pt # Portugese