1
0
Fork 0
mirror of https://github.com/gsantner/dandelion synced 2025-12-15 08:41:10 +01:00

BIG REFACTORING - 0.1.6-next edition

This commit is contained in:
Gregor Santner 2016-10-26 16:23:14 +02:00
parent e239f519e4
commit b7ca97208a
103 changed files with 555 additions and 1015 deletions

View file

@ -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() {

View file

@ -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());
}
}
}

View file

@ -16,7 +16,7 @@
If not, see <http://www.gnu.org/licenses/>.
*/
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<AspectAdapter.ViewHolder> {
private AppSettings appSettings;
private PodAspect[] aspectList;
private DiasporaAspect[] aspectList;
private List<String> aspectFavsList;
private OnSomethingClickListener<Object> 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

View file

@ -16,7 +16,7 @@
If not, see <http://www.gnu.org/licenses/>.
*/
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");
}
}

View file

@ -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();

View file

@ -16,13 +16,12 @@
If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

View file

@ -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();

View file

@ -16,7 +16,7 @@
If not, see <http://www.gnu.org/licenses/>.
*/
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<Object> {
public class TagListFragment extends ThemedFragment implements OnSomethingClickListener<Object> {
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

View file

@ -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() {

View file

@ -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;
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}

View file

@ -1,4 +1,4 @@
package com.github.dfa.diaspora_android.ui;
package com.github.dfa.diaspora_android.listener;
import android.support.design.widget.AppBarLayout;

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}

View file

@ -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

View file

@ -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;
/**

View file

@ -17,15 +17,13 @@
If not, see <http://www.gnu.org/licenses/>.
*/
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 {

View file

@ -16,7 +16,7 @@
If not, see <http://www.gnu.org/licenses/>.
*/
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

View file

@ -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) {

View file

@ -16,7 +16,7 @@
If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.dfa.diaspora_android.task;
package com.github.dfa.diaspora_android.service;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

View file

@ -16,14 +16,14 @@
If not, see <http://www.gnu.org/licenses/>.
*/
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<Void, Void, Void> {
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());
}

View file

@ -16,7 +16,7 @@
If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.dfa.diaspora_android.task;
package com.github.dfa.diaspora_android.service;
import android.content.Context;
import android.os.AsyncTask;

View file

@ -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/

View file

@ -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 {

View file

@ -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);

View file

@ -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;

View file

@ -16,7 +16,7 @@
If not, see <http://www.gnu.org/licenses/>.
*/
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

View file

@ -17,7 +17,7 @@
If not, see <http://www.gnu.org/licenses/>.
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();
}
}

View file

@ -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

View file

@ -16,7 +16,7 @@
If not, see <http://www.gnu.org/licenses/>.
*/
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

View file

@ -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

View file

@ -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);

View file

@ -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;
/**

View file

@ -16,11 +16,10 @@
If not, see <http://www.gnu.org/licenses/>.
*/
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

View file

@ -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);
}

View file

@ -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) {

View file

@ -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?

View file

@ -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<String> logBuffer;
private ArrayList<Observer> 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<String> 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);
}
}
}

View file

@ -12,7 +12,7 @@
along with the Diaspora for Android.
If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

View file

@ -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;
}

View file

@ -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;

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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<String> logBuffer;
private ArrayList<Observer> 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<String> 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);
}
}

View file

@ -16,7 +16,7 @@
If not, see <http://www.gnu.org/licenses/>.
*/
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;

View file

@ -16,7 +16,7 @@
If not, see <http://www.gnu.org/licenses/>.
*/
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;

View file

@ -16,7 +16,7 @@
If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.dfa.diaspora_android.webview;
package com.github.dfa.diaspora_android.web;
import android.content.Intent;
import android.support.v4.content.LocalBroadcastManager;

View file

@ -16,13 +16,12 @@
If not, see <http://www.gnu.org/licenses/>.
*/
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.

View file

@ -16,7 +16,7 @@
If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.dfa.diaspora_android.webview;
package com.github.dfa.diaspora_android.web;
import android.net.Uri;
import android.webkit.ValueCallback;

View file

@ -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;

View file

@ -16,7 +16,7 @@
If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.dfa.diaspora_android.webview;
package com.github.dfa.diaspora_android.web;
import android.view.View;
import android.webkit.WebChromeClient;

View file

@ -16,14 +16,15 @@
If not, see <http://www.gnu.org/licenses/>.
*/
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;

View file

@ -17,7 +17,7 @@
If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.dfa.diaspora_android.util;
package com.github.dfa.diaspora_android.web;
import android.content.Context;
import android.net.ConnectivityManager;

View file

@ -16,7 +16,7 @@
If not, see <http://www.gnu.org/licenses/>.
*/
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;

View file

@ -16,7 +16,7 @@
If not, see <http://www.gnu.org/licenses/>.
*/
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;

View file

@ -16,7 +16,7 @@
If not, see <http://www.gnu.org/licenses/>.
*/
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;