mirror of
https://github.com/gsantner/dandelion
synced 2024-11-22 04:12:08 +01:00
Merge branch 'master' into poddy_as_podsource
This commit is contained in:
commit
110598ea85
56 changed files with 2028 additions and 322 deletions
|
@ -30,3 +30,6 @@ notifications:
|
|||
on_success: change # options: [always|never|change] default: always
|
||||
on_failure: always # options: [always|never|change] default: always
|
||||
on_start: never # options: [always|never|change] default: always
|
||||
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
# v0.1.7 wip
|
||||
- Added: Custom Theme Colors!
|
||||
- Increased the overall performance by using Fragments
|
||||
- Lots of bugfixes
|
||||
- Fixes for the bugfixes!
|
||||
|
||||
# v0.1.6
|
||||
- Added: New languages
|
||||
- Changed: New delicious visual style + launcher icon
|
||||
|
|
|
@ -14,6 +14,7 @@ You should have received a copy of the GNU General Public License
|
|||
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
|
||||
|
||||
# Splashscreen-Images
|
||||
# Miscellaneous
|
||||
|
||||
The splashscreen images can be found on [flickr](https://www.flickr.com/photos/129581906@N06/sets/72157651933980136/with/16594947123/).
|
||||
We took some inspiration and code from LeafPic. Go check it out, its free software as well!
|
||||
https://github.com/HoraApps/LeafPic
|
|
@ -41,3 +41,6 @@ Diaspora for Android requires access to the Internet and to external storage to
|
|||
## Maintainers
|
||||
- gsantner ([GitHub](https://github.com/gsantner), [Web](https://gsantner.github.io), [diaspora*](https://pod.geraspora.de/people/d1cbdd70095301341e834860008dbc6c))
|
||||
- vanitasvitae ([GitHub](https://github.com/vanitasvitae), [Diaspora](https://pod.geraspora.de/people/bbd7af90fbec013213e34860008dbc6c))
|
||||
|
||||
## Acknowledgements
|
||||
- We took some inspiration and code from [LeafPic](https://github.com/HoraApps/LeafPic), big thanks to Donald Shtjefni and the LeafPic Team!
|
||||
|
|
|
@ -31,6 +31,13 @@ android {
|
|||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
//Color picker
|
||||
url "http://dl.bintray.com/dasar/maven"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Sub-Projects
|
||||
//compile project(':subprojectFromRoot')
|
||||
|
@ -40,15 +47,16 @@ dependencies {
|
|||
testCompile 'junit:junit:4.12'
|
||||
|
||||
// Android standard libs
|
||||
compile 'com.android.support:appcompat-v7:24.2.0'
|
||||
compile 'com.android.support:design:24.1.0' //Don't u dare to upd8!
|
||||
compile 'com.android.support:support-v4:24.2.0'
|
||||
compile "com.android.support:customtabs:24.2.0"
|
||||
compile 'com.android.support:appcompat-v7:24.2.1'
|
||||
compile 'com.android.support:design:24.1.0' //Don't update. Broken up to 24.2.1
|
||||
compile 'com.android.support:support-v4:24.2.1'
|
||||
compile "com.android.support:customtabs:24.2.1"
|
||||
|
||||
// More libraries
|
||||
compile 'com.jakewharton:butterknife:8.0.1'
|
||||
compile 'info.guardianproject.netcipher:netcipher:2.0.0-alpha1'
|
||||
compile 'info.guardianproject.netcipher:netcipher-webkit:2.0.0-alpha1'
|
||||
compile(group: 'uz.shift', name: 'colorpicker', version: '0.5', ext: 'aar') //Color picker
|
||||
apt 'com.jakewharton:butterknife-compiler:8.0.1'
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
android:icon="@drawable/ic_launcher"
|
||||
android:name="com.github.dfa.diaspora_android.App"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme" >
|
||||
android:theme="@style/DiasporaLight" >
|
||||
|
||||
<provider
|
||||
android:name="com.github.dfa.diaspora_android.data.HashtagProvider"
|
||||
|
@ -25,20 +25,20 @@
|
|||
<activity
|
||||
android:name=".activity.SettingsActivity"
|
||||
android:launchMode="singleInstance"
|
||||
android:theme="@style/AppTheme"
|
||||
android:theme="@style/DiasporaLight.NoActionBar"
|
||||
android:label="@string/settings" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.AboutActivity"
|
||||
android:label="@string/about_activity__title_about_app"
|
||||
android:theme="@style/AppTheme.NoActionBar"/>
|
||||
android:theme="@style/DiasporaLight.NoActionBar"/>
|
||||
|
||||
<activity
|
||||
android:name=".activity.MainActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="adjustResize"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:theme="@style/DiasporaLight.NoActionBar"
|
||||
android:label="@string/diaspora">
|
||||
|
||||
<intent-filter>
|
||||
|
|
|
@ -31,9 +31,10 @@ import android.support.v4.app.Fragment;
|
|||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentPagerAdapter;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
|
@ -43,10 +44,14 @@ 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.ui.HtmlTextView;
|
||||
import com.github.dfa.diaspora_android.ui.IntellihideToolbarActivityListener;
|
||||
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.Log;
|
||||
import com.github.dfa.diaspora_android.util.theming.ThemeHelper;
|
||||
|
||||
import java.util.Observable;
|
||||
import java.util.Observer;
|
||||
|
@ -57,17 +62,24 @@ import butterknife.ButterKnife;
|
|||
/**
|
||||
* Activity that holds some fragments that show information about the app in a tab layout
|
||||
*/
|
||||
public class AboutActivity extends AppCompatActivity {
|
||||
public class AboutActivity extends ThemedActivity
|
||||
implements IntellihideToolbarActivityListener {
|
||||
|
||||
private SectionsPagerAdapter mSectionsPagerAdapter;
|
||||
private ViewPager mViewPager;
|
||||
|
||||
@BindView(R.id.about__appbar)
|
||||
AppBarLayout appBarLayout;
|
||||
|
||||
@BindView(R.id.main__topbar)
|
||||
protected Toolbar toolbar;
|
||||
|
||||
@BindView(R.id.appbar_linear_layout)
|
||||
protected LinearLayout linearLayout;
|
||||
|
||||
@BindView(R.id.tabs)
|
||||
protected TabLayout tabLayout;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -87,23 +99,58 @@ public class AboutActivity extends AppCompatActivity {
|
|||
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
|
||||
|
||||
// Set up the ViewPager with the sections adapter.
|
||||
mViewPager = (ViewPager) findViewById(R.id.container);
|
||||
mViewPager = ButterKnife.findById(this, R.id.container);
|
||||
mViewPager.setAdapter(mSectionsPagerAdapter);
|
||||
|
||||
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
|
||||
tabLayout.setupWithViewPager(mViewPager);
|
||||
}
|
||||
|
||||
//Apply intellihide
|
||||
if (!((App) getApplication()).getSettings().isIntellihideToolbars()) {
|
||||
AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) linearLayout.getLayoutParams();
|
||||
params.setScrollFlags(0);
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if(getAppSettings().isIntellihideToolbars()) {
|
||||
this.enableToolbarHiding();
|
||||
} else {
|
||||
this.disableToolbarHiding();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyColorToViews() {
|
||||
ThemeHelper.updateToolbarColor(toolbar);
|
||||
ThemeHelper.updateTabLayoutColor(tabLayout);
|
||||
ThemeHelper.setPrimaryColorAsBackground(linearLayout);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableToolbarHiding() {
|
||||
AppLog.d(this, "Enable Intellihide");
|
||||
AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) linearLayout.getLayoutParams();
|
||||
//scroll|enterAlways|snap
|
||||
params.setScrollFlags(toolbarDefaultScrollFlags);
|
||||
appBarLayout.setExpanded(true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableToolbarHiding() {
|
||||
AppLog.d(this, "Disable Intellihide");
|
||||
AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) linearLayout.getLayoutParams();
|
||||
params.setScrollFlags(0); // clear all scroll flags
|
||||
appBarLayout.setExpanded(true, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fragment that shows general information about the app
|
||||
*/
|
||||
public static class AboutFragment extends Fragment {
|
||||
public static class AboutFragment extends ThemedFragment {
|
||||
|
||||
public static final String TAG = "com.github.dfa.diaspora_android.AboutActivity.AboutFragment";
|
||||
|
||||
@BindView(R.id.fragment_about__about_text)
|
||||
TextView aboutText;
|
||||
|
||||
@BindView(R.id.fragment_about__app_version)
|
||||
TextView appVersion;
|
||||
|
||||
public AboutFragment() {
|
||||
}
|
||||
|
@ -112,8 +159,7 @@ public class AboutActivity extends AppCompatActivity {
|
|||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View rootView = inflater.inflate(R.layout.about__fragment_about, container, false);
|
||||
TextView appVersion = (TextView) rootView.findViewById(R.id.fragment_about__app_version);
|
||||
|
||||
ButterKnife.bind(this, rootView);
|
||||
if (isAdded()) {
|
||||
try {
|
||||
PackageInfo pInfo = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0);
|
||||
|
@ -125,18 +171,42 @@ public class AboutActivity extends AppCompatActivity {
|
|||
}
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyColorToViews() {
|
||||
ThemeHelper.updateTextViewColor(aboutText);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFragmentTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateBottomOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
/* Nothing to do */
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBackPressed() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fragment that shows information about the license of the app and used 3rd party libraries
|
||||
*/
|
||||
public static class LicenseFragment extends Fragment {
|
||||
public static class LicenseFragment extends ThemedFragment {
|
||||
public static final String TAG = "com.github.dfa.diaspora_android.AboutActivity.LicenseFragment";
|
||||
|
||||
@BindView(R.id.fragment_license__licensetext)
|
||||
HtmlTextView textLicenseBox;
|
||||
|
||||
@BindView(R.id.fragment_license__3rdparty)
|
||||
HtmlTextView textLicense3partyBox;
|
||||
|
||||
private String accentColor;
|
||||
|
||||
|
||||
public LicenseFragment() {
|
||||
}
|
||||
|
@ -146,7 +216,7 @@ public class AboutActivity extends AppCompatActivity {
|
|||
View rootView = inflater.inflate(R.layout.about__fragment_license, container, false);
|
||||
ButterKnife.bind(this, rootView);
|
||||
final Context context = rootView.getContext();
|
||||
accentColor = Helpers.hexColorFromRessourceColor(context, R.color.colorAccent);
|
||||
accentColor = Helpers.colorToHex(ThemeHelper.getAccentColor());
|
||||
|
||||
textLicenseBox.setTextFormatted(getString(R.string.fragment_license__license_content,
|
||||
getMaintainersHtml(context),
|
||||
|
@ -160,8 +230,6 @@ public class AboutActivity extends AppCompatActivity {
|
|||
return rootView;
|
||||
}
|
||||
|
||||
private String accentColor;
|
||||
|
||||
public String getContributorsHtml(Context context) {
|
||||
String text = Helpers.readTextfileFromRawRessource(context, R.raw.contributors,
|
||||
"<font color='" + accentColor + "'><b>*</b></font> ", "<br>");
|
||||
|
@ -187,13 +255,52 @@ public class AboutActivity extends AppCompatActivity {
|
|||
text = text.replace("NEWENTRY", "<font color='" + accentColor + "'><b>*</b></font> ");
|
||||
return text;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyColorToViews() {
|
||||
ThemeHelper.updateTextViewColor(textLicense3partyBox);
|
||||
ThemeHelper.updateTextViewColor(textLicenseBox);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFragmentTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateBottomOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
/* Nothing to do */
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBackPressed() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fragment that shows debug information like app version, pod version...
|
||||
*/
|
||||
public static class DebugFragment extends Fragment implements Observer {
|
||||
private TextView logBox;
|
||||
public static final String TAG = "com.github.dfa.diaspora_android.AboutActivity.DebugFragment";
|
||||
|
||||
@BindView(R.id.fragment_debug__package_name)
|
||||
TextView packageName;
|
||||
|
||||
@BindView(R.id.fragment_debug__app_version)
|
||||
TextView appVersion;
|
||||
|
||||
@BindView(R.id.fragment_debug__android_version)
|
||||
TextView osVersion;
|
||||
|
||||
@BindView(R.id.fragment_debug__device_name)
|
||||
TextView deviceName;
|
||||
|
||||
@BindView(R.id.fragment_debug__pod_domain)
|
||||
TextView podDomain;
|
||||
|
||||
@BindView(R.id.fragment_debug__log_box)
|
||||
TextView logBox;
|
||||
|
||||
public DebugFragment() {
|
||||
}
|
||||
|
@ -202,16 +309,11 @@ public class AboutActivity extends AppCompatActivity {
|
|||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View rootView = inflater.inflate(R.layout.about__fragment_debug, container, false);
|
||||
TextView packageName = (TextView) rootView.findViewById(R.id.fragment_debug__package_name);
|
||||
TextView appVersion = (TextView) rootView.findViewById(R.id.fragment_debug__app_version);
|
||||
TextView osVersion = (TextView) rootView.findViewById(R.id.fragment_debug__android_version);
|
||||
TextView deviceName = (TextView) rootView.findViewById(R.id.fragment_debug__device_name);
|
||||
TextView podDomain = (TextView) rootView.findViewById(R.id.fragment_debug__pod_domain);
|
||||
logBox = (TextView) rootView.findViewById(R.id.fragment_debug__log_box);
|
||||
ButterKnife.bind(this, rootView);
|
||||
App app = (App) getActivity().getApplication();
|
||||
logBox.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View view) {
|
||||
AppLog.d(this, "Long click registered");
|
||||
if (isAdded()) {
|
||||
ClipboardManager clipboard = (ClipboardManager) getActivity().getSystemService(CLIPBOARD_SERVICE);
|
||||
ClipData clip = ClipData.newPlainText("DEBUG_LOG", Log.getLogBuffer());
|
||||
|
@ -229,15 +331,16 @@ public class AboutActivity extends AppCompatActivity {
|
|||
if (isAdded()) {
|
||||
try {
|
||||
PackageInfo pInfo = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0);
|
||||
AppSettings settings = ((App) getActivity().getApplication()).getSettings();
|
||||
|
||||
AppSettings appSettings = ((App) getActivity().getApplication()).getSettings();
|
||||
DiasporaUrlHelper urls = new DiasporaUrlHelper(appSettings);
|
||||
packageName.setText(pInfo.packageName);
|
||||
appVersion.setText(getString(R.string.fragment_debug__app_version, pInfo.versionName + " (" + pInfo.versionCode + ")"));
|
||||
|
||||
osVersion.setText(getString(R.string.fragment_debug__android_version, Build.VERSION.RELEASE));
|
||||
deviceName.setText(getString(R.string.fragment_debug__device_name, Build.MANUFACTURER + " " + Build.MODEL));
|
||||
if (settings.getPod() != null) {
|
||||
podDomain.setText(getString(R.string.fragment_debug__pod_domain, settings.getPod().getName()));
|
||||
podDomain.setText(getString(R.string.fragment_debug__pod_domain, urls.getPodUrl()));
|
||||
if (app.getSettings().getPod() != null) {
|
||||
podDomain.setText(getString(R.string.fragment_debug__pod_domain, app.getSettings().getPod().getName()));
|
||||
}
|
||||
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
|
|
|
@ -54,6 +54,7 @@ import android.widget.EditText;
|
|||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
|
@ -68,18 +69,25 @@ 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.receiver.OpenExternalLinkReceiver;
|
||||
import com.github.dfa.diaspora_android.util.ProxyHandler;
|
||||
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.util.AppLog;
|
||||
import com.github.dfa.diaspora_android.util.CustomTabHelpers.CustomTabActivityHelper;
|
||||
import com.github.dfa.diaspora_android.util.DiasporaUrlHelper;
|
||||
import com.github.dfa.diaspora_android.util.theming.ThemeHelper;
|
||||
import com.github.dfa.diaspora_android.util.WebHelper;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
|
||||
public class MainActivity extends AppCompatActivity
|
||||
implements NavigationView.OnNavigationItemSelectedListener, WebUserProfileChangedListener, CustomTabActivityHelper.ConnectionCallback {
|
||||
public class MainActivity extends ThemedActivity
|
||||
implements NavigationView.OnNavigationItemSelectedListener,
|
||||
WebUserProfileChangedListener,
|
||||
CustomTabActivityHelper.ConnectionCallback,
|
||||
IntellihideToolbarActivityListener {
|
||||
|
||||
|
||||
public static final int REQUEST_CODE_ASK_PERMISSIONS = 123;
|
||||
|
@ -92,7 +100,6 @@ public class MainActivity extends AppCompatActivity
|
|||
public static final String ACTION_CHANGE_ACCOUNT = "com.github.dfa.diaspora_android.MainActivity.change_account";
|
||||
public static final String ACTION_CLEAR_CACHE = "com.github.dfa.diaspora_android.MainActivity.clear_cache";
|
||||
public static final String ACTION_UPDATE_TITLE_FROM_URL = "com.github.dfa.diaspora_android.MainActivity.set_title";
|
||||
public static final String ACTION_RELOAD_ACTIVITY = "com.github.dfa.diaspora_android.MainActivity.reload_activity";
|
||||
public static final String URL_MESSAGE = "URL_MESSAGE";
|
||||
public static final String EXTRA_URL = "com.github.dfa.diaspora_android.extra_url";
|
||||
public static final String CONTENT_HASHTAG = "content://com.github.dfa.diaspora_android.mainactivity/";
|
||||
|
@ -113,6 +120,9 @@ public class MainActivity extends AppCompatActivity
|
|||
/**
|
||||
* UI Bindings
|
||||
*/
|
||||
@BindView(R.id.main__appbar)
|
||||
AppBarLayout appBarLayout;
|
||||
|
||||
@BindView(R.id.main__topbar)
|
||||
Toolbar toolbarTop;
|
||||
|
||||
|
@ -128,6 +138,9 @@ public class MainActivity extends AppCompatActivity
|
|||
@BindView(R.id.main__navdrawer)
|
||||
DrawerLayout navDrawer;
|
||||
|
||||
RelativeLayout navDrawerLayout;
|
||||
LinearLayout navProfilePictureArea;
|
||||
|
||||
|
||||
// NavHeader cannot be bound by Butterknife
|
||||
private TextView navheaderTitle;
|
||||
|
@ -160,6 +173,7 @@ public class MainActivity extends AppCompatActivity
|
|||
urls = new DiasporaUrlHelper(appSettings);
|
||||
customTabActivityHelper = new CustomTabActivityHelper();
|
||||
customTabActivityHelper.setConnectionCallback(this);
|
||||
ProxyHandler.getInstance().updateProxySettings(this);
|
||||
|
||||
fm = getSupportFragmentManager();
|
||||
setupUI();
|
||||
|
@ -169,7 +183,7 @@ public class MainActivity extends AppCompatActivity
|
|||
@Override
|
||||
public void setTitle(int rId) {
|
||||
CustomFragment top = getTopFragment();
|
||||
if (top != null && top.getFragmentTag().equals(DiasporaStreamFragment.TAG)) {
|
||||
if(top != null && top.getFragmentTag().equals(DiasporaStreamFragment.TAG)) {
|
||||
MainActivity.this.setTitle(rId);
|
||||
}
|
||||
}
|
||||
|
@ -177,7 +191,7 @@ public class MainActivity extends AppCompatActivity
|
|||
@Override
|
||||
public void setTitle(String title) {
|
||||
CustomFragment top = getTopFragment();
|
||||
if (top != null && top.getFragmentTag().equals(DiasporaStreamFragment.TAG)) {
|
||||
if(top != null && top.getFragmentTag().equals(DiasporaStreamFragment.TAG)) {
|
||||
MainActivity.this.setTitle(title);
|
||||
}
|
||||
}
|
||||
|
@ -229,19 +243,11 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
// Load app settings
|
||||
setupNavigationSlider();
|
||||
|
||||
if (!appSettings.isIntellihideToolbars()) {
|
||||
AppLog.v(this, "Disable intelligent hiding of toolbars");
|
||||
AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) toolbarTop.getLayoutParams();
|
||||
params.setScrollFlags(0); // clear all scroll flags
|
||||
}
|
||||
|
||||
AppLog.v(this, "UI successfully set up");
|
||||
}
|
||||
|
||||
/**
|
||||
* Show DiasporaStreamFragment if necessary and load URL url
|
||||
*
|
||||
* @param url URL to load in the DiasporaStreamFragment
|
||||
*/
|
||||
public void openDiasporaUrl(String url) {
|
||||
|
@ -255,13 +261,12 @@ public class MainActivity extends AppCompatActivity
|
|||
* Get an instance of the CustomFragment with the tag fragmentTag.
|
||||
* If there was no instance so far, create a new one and add it to the FragmentManagers pool.
|
||||
* If there is no Fragment with the corresponding Tag, return the top fragment.
|
||||
*
|
||||
* @param fragmentTag tag
|
||||
* @return corresponding Fragment
|
||||
*/
|
||||
protected CustomFragment getFragment(String fragmentTag) {
|
||||
CustomFragment fragment = (CustomFragment) fm.findFragmentByTag(fragmentTag);
|
||||
if (fragment != null) {
|
||||
if(fragment != null) {
|
||||
return fragment;
|
||||
} else {
|
||||
switch (fragmentTag) {
|
||||
|
@ -282,8 +287,8 @@ public class MainActivity extends AppCompatActivity
|
|||
fm.beginTransaction().add(psf, fragmentTag).commit();
|
||||
return psf;
|
||||
default:
|
||||
AppLog.e(this, "Invalid Fragment Tag: " + fragmentTag
|
||||
+ "\nAdd Fragments Tag to getFragment()'s switch case.");
|
||||
AppLog.e(this,"Invalid Fragment Tag: "+fragmentTag
|
||||
+"\nAdd Fragments Tag to getFragment()'s switch case.");
|
||||
return getTopFragment();
|
||||
}
|
||||
}
|
||||
|
@ -291,13 +296,12 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
/**
|
||||
* Show the Fragment fragment in R.id.fragment_container. If the fragment was already visible, do nothing.
|
||||
*
|
||||
* @param fragment Fragment to show
|
||||
*/
|
||||
protected void showFragment(CustomFragment fragment) {
|
||||
AppLog.v(this, "showFragment()");
|
||||
CustomFragment currentTop = (CustomFragment) fm.findFragmentById(R.id.fragment_container);
|
||||
if (currentTop == null || !currentTop.getFragmentTag().equals(fragment.getFragmentTag())) {
|
||||
if(currentTop == null || !currentTop.getFragmentTag().equals(fragment.getFragmentTag())) {
|
||||
AppLog.v(this, "Fragment was not visible. Replace it.");
|
||||
fm.beginTransaction().addToBackStack(null).replace(R.id.fragment_container, fragment, fragment.getFragmentTag()).commit();
|
||||
invalidateOptionsMenu();
|
||||
|
@ -319,9 +323,10 @@ public class MainActivity extends AppCompatActivity
|
|||
navView.setNavigationItemSelectedListener(this);
|
||||
|
||||
View navHeader = navView.getHeaderView(0);
|
||||
LinearLayout navheaderProfileSection = ButterKnife.findById(navHeader, R.id.nav_profile_picture);
|
||||
navProfilePictureArea = ButterKnife.findById(navHeader, R.id.nav_profile_picture);
|
||||
navDrawerLayout = ButterKnife.findById(navHeader, R.id.nav_drawer);
|
||||
//Handle clicks on profile picture
|
||||
navheaderProfileSection.setOnClickListener(new View.OnClickListener() {
|
||||
navProfilePictureArea.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
navDrawer.closeDrawer(GravityCompat.START);
|
||||
|
@ -358,11 +363,30 @@ public class MainActivity extends AppCompatActivity
|
|||
}
|
||||
}
|
||||
}
|
||||
updateNavigationViewEntryVisibilities();
|
||||
}
|
||||
|
||||
protected void updateNavigationViewEntryVisibilities() {
|
||||
Menu navMenu = navView.getMenu();
|
||||
navMenu.findItem(R.id.nav_exit).setVisible(appSettings.isVisibleInNavExit());
|
||||
navMenu.findItem(R.id.nav_activities).setVisible(appSettings.isVisibleInNavActivities());
|
||||
navMenu.findItem(R.id.nav_aspects).setVisible(appSettings.isVisibleInNavAspects());
|
||||
navMenu.findItem(R.id.nav_commented).setVisible(appSettings.isVisibleInNavCommented());
|
||||
navMenu.findItem(R.id.nav_followed_tags).setVisible(appSettings.isVisibleInNavFollowed_tags());
|
||||
navMenu.findItem(R.id.nav_about).setVisible(appSettings.isVisibleInNavHelp_license());
|
||||
navMenu.findItem(R.id.nav_liked).setVisible(appSettings.isVisibleInNavLiked());
|
||||
navMenu.findItem(R.id.nav_mentions).setVisible(appSettings.isVisibleInNavMentions());
|
||||
navMenu.findItem(R.id.nav_profile).setVisible(appSettings.isVisibleInNavProfile());
|
||||
navMenu.findItem(R.id.nav_public).setVisible(appSettings.isVisibleInNavPublic_activities());
|
||||
|
||||
// Top bar
|
||||
if (appSettings.getPod() == null) {
|
||||
navMenu.setGroupVisible(navMenu.findItem(R.id.nav_exit).getGroupId(), false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Forward incoming intents to handleIntent()
|
||||
*
|
||||
* @param intent incoming
|
||||
*/
|
||||
@Override
|
||||
|
@ -373,7 +397,6 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
/**
|
||||
* Handle intents and execute intent specific actions
|
||||
*
|
||||
* @param intent intent to get handled
|
||||
*/
|
||||
private void handleIntent(Intent intent) {
|
||||
|
@ -398,7 +421,7 @@ public class MainActivity extends AppCompatActivity
|
|||
return;
|
||||
} else {
|
||||
loadUrl = intent.getDataString();
|
||||
AppLog.v(this, "Intent has a delicious URL for us: " + loadUrl);
|
||||
AppLog.v(this, "Intent has a delicious URL for us: "+loadUrl);
|
||||
}
|
||||
} else if (ACTION_CHANGE_ACCOUNT.equals(action)) {
|
||||
AppLog.v(this, "Reset pod data and show PodSelectionFragment");
|
||||
|
@ -408,10 +431,6 @@ public class MainActivity extends AppCompatActivity
|
|||
} else if (ACTION_CLEAR_CACHE.equals(action)) {
|
||||
AppLog.v(this, "Clear WebView cache");
|
||||
((DiasporaStreamFragment) getFragment(DiasporaStreamFragment.TAG)).getWebView().clearCache(true);
|
||||
} else if (ACTION_RELOAD_ACTIVITY.equals(action)) {
|
||||
AppLog.v(this, "Recreate activity");
|
||||
recreate();
|
||||
return;
|
||||
} else if (Intent.ACTION_SEND.equals(action) && type != null) {
|
||||
switch (type) {
|
||||
case "text/plain":
|
||||
|
@ -438,25 +457,23 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
/**
|
||||
* Handle activity results
|
||||
*
|
||||
* @param requestCode reqCode
|
||||
* @param resultCode resCode
|
||||
* @param data data
|
||||
* @param resultCode resCode
|
||||
* @param data data
|
||||
*/
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
AppLog.v(this, "onActivityResult(): " + requestCode);
|
||||
AppLog.v(this, "onActivityResult(): "+requestCode);
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the fragment which is currently displayed in R.id.fragment_container
|
||||
*
|
||||
* @return top fragment or null if there is none displayed
|
||||
*/
|
||||
private CustomFragment getTopFragment() {
|
||||
Fragment top = fm.findFragmentById(R.id.fragment_container);
|
||||
if (top != null) {
|
||||
if(top != null) {
|
||||
return (CustomFragment) top;
|
||||
}
|
||||
return null;
|
||||
|
@ -473,12 +490,12 @@ public class MainActivity extends AppCompatActivity
|
|||
return;
|
||||
}
|
||||
CustomFragment top = getTopFragment();
|
||||
if (top != null) {
|
||||
if(top != null) {
|
||||
AppLog.v(this, "Top Fragment is not null");
|
||||
if (!top.onBackPressed()) {
|
||||
if(!top.onBackPressed()) {
|
||||
AppLog.v(this, "Top Fragment.onBackPressed was false");
|
||||
AppLog.v(this, "BackStackEntryCount: " + fm.getBackStackEntryCount());
|
||||
if (fm.getBackStackEntryCount() > 0) {
|
||||
AppLog.v(this, "BackStackEntryCount: "+fm.getBackStackEntryCount());
|
||||
if(fm.getBackStackEntryCount()>0) {
|
||||
fm.popBackStack();
|
||||
} else {
|
||||
snackbarExitApp.show();
|
||||
|
@ -523,12 +540,18 @@ public class MainActivity extends AppCompatActivity
|
|||
AppLog.v(this, "Register BroadcastReceivers");
|
||||
LocalBroadcastManager.getInstance(this).registerReceiver(brSetTitle, new IntentFilter(ACTION_UPDATE_TITLE_FROM_URL));
|
||||
LocalBroadcastManager.getInstance(this).registerReceiver(brOpenExternalLink, new IntentFilter(ACTION_OPEN_EXTERNAL_URL));
|
||||
this.appSettings = getAppSettings();
|
||||
if (appSettings.isIntellihideToolbars()) {
|
||||
this.enableToolbarHiding();
|
||||
} else {
|
||||
this.disableToolbarHiding();
|
||||
}
|
||||
updateNavigationViewEntryVisibilities();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear and repopulate top and bottom toolbar.
|
||||
* Also add menu items of the displayed fragment
|
||||
*
|
||||
* @param menu top toolbar
|
||||
* @return boolean
|
||||
*/
|
||||
|
@ -541,9 +564,9 @@ public class MainActivity extends AppCompatActivity
|
|||
toolbarBottom.setVisibility(View.VISIBLE);
|
||||
|
||||
CustomFragment top = getTopFragment();
|
||||
if (top != null) {
|
||||
if(top != null) {
|
||||
//Are we displaying a Fragment other than PodSelectionFragment?
|
||||
if (!top.getFragmentTag().equals(PodSelectionFragment.TAG)) {
|
||||
if(!top.getFragmentTag().equals(PodSelectionFragment.TAG)) {
|
||||
getMenuInflater().inflate(R.menu.main__menu_top, menu);
|
||||
getMenuInflater().inflate(R.menu.main__menu_bottom, toolbarBottom.getMenu());
|
||||
top.onCreateBottomOptionsMenu(toolbarBottom.getMenu(), getMenuInflater());
|
||||
|
@ -559,30 +582,13 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
/**
|
||||
* Set the notification and messages counter in the top toolbar
|
||||
*
|
||||
* @param menu menu
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean onPrepareOptionsMenu(Menu menu) {
|
||||
// Navigation slider
|
||||
Menu navMenu = navView.getMenu();
|
||||
navMenu.findItem(R.id.nav_exit).setVisible(appSettings.isVisibleInNavExit());
|
||||
navMenu.findItem(R.id.nav_activities).setVisible(appSettings.isVisibleInNavActivities());
|
||||
navMenu.findItem(R.id.nav_aspects).setVisible(appSettings.isVisibleInNavAspects());
|
||||
navMenu.findItem(R.id.nav_commented).setVisible(appSettings.isVisibleInNavCommented());
|
||||
navMenu.findItem(R.id.nav_followed_tags).setVisible(appSettings.isVisibleInNavFollowed_tags());
|
||||
navMenu.findItem(R.id.nav_about).setVisible(appSettings.isVisibleInNavHelp_license());
|
||||
navMenu.findItem(R.id.nav_liked).setVisible(appSettings.isVisibleInNavLiked());
|
||||
navMenu.findItem(R.id.nav_mentions).setVisible(appSettings.isVisibleInNavMentions());
|
||||
navMenu.findItem(R.id.nav_profile).setVisible(appSettings.isVisibleInNavProfile());
|
||||
navMenu.findItem(R.id.nav_public).setVisible(appSettings.isVisibleInNavPublic_activities());
|
||||
|
||||
// Top bar
|
||||
MenuItem item;
|
||||
if (appSettings.getPod() == null) {
|
||||
navMenu.setGroupVisible(navView.getMenu().findItem(R.id.nav_exit).getGroupId(), false);
|
||||
}
|
||||
updateNavigationViewEntryVisibilities();
|
||||
|
||||
if ((item = menu.findItem(R.id.action_notifications)) != null) {
|
||||
LayerDrawable icon = (LayerDrawable) item.getIcon();
|
||||
|
@ -598,7 +604,6 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
/**
|
||||
* Handle clicks on the optionsmenu
|
||||
*
|
||||
* @param item item
|
||||
* @return boolean
|
||||
*/
|
||||
|
@ -697,7 +702,6 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
/**
|
||||
* Update the profile name in the navigation slider
|
||||
*
|
||||
* @param name name
|
||||
*/
|
||||
@Override
|
||||
|
@ -708,7 +712,6 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
/**
|
||||
* Update the profile picture in the navigation slider
|
||||
*
|
||||
* @param avatarUrl url of the new profile pic
|
||||
*/
|
||||
@Override
|
||||
|
@ -719,7 +722,6 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
/**
|
||||
* Handle hashtag clicks. Open the new-post-url and inject the clicked hashtag into the post-editor
|
||||
*
|
||||
* @param intent intent
|
||||
*/
|
||||
private void handleHashtag(Intent intent) {
|
||||
|
@ -734,7 +736,6 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
/**
|
||||
* Open the new-post-url and inject text that was shared into the app into the post editors text field
|
||||
*
|
||||
* @param intent shareTextIntent
|
||||
*/
|
||||
private void handleSendText(Intent intent) {
|
||||
|
@ -793,7 +794,6 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
/**
|
||||
* Share an image shared to the app via diaspora
|
||||
*
|
||||
* @param intent shareImageIntent
|
||||
*/
|
||||
//TODO: Implement some day
|
||||
|
@ -810,7 +810,6 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
/**
|
||||
* Invalidate the top toolbar to update the notification counter
|
||||
*
|
||||
* @param notificationCount new notification count
|
||||
*/
|
||||
@Override
|
||||
|
@ -822,7 +821,6 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
/**
|
||||
* Invalidate the top toolbar to update the unread messages counter
|
||||
*
|
||||
* @param unreadMessageCount new unread messages count
|
||||
*/
|
||||
@Override
|
||||
|
@ -834,8 +832,8 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
@Override
|
||||
public void onCustomTabsConnected() {
|
||||
if (customTabsSession == null) {
|
||||
AppLog.i(this, "CustomTabs warmup: " + customTabActivityHelper.warmup(0));
|
||||
if(customTabsSession == null) {
|
||||
AppLog.i(this, "CustomTabs warmup: "+customTabActivityHelper.warmup(0));
|
||||
customTabsSession = customTabActivityHelper.getSession();
|
||||
}
|
||||
}
|
||||
|
@ -955,9 +953,8 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
/**
|
||||
* React to results of requestPermission
|
||||
*
|
||||
* @param requestCode resCode
|
||||
* @param permissions requested permissions
|
||||
* @param requestCode resCode
|
||||
* @param permissions requested permissions
|
||||
* @param grantResults granted results
|
||||
*/
|
||||
@Override
|
||||
|
@ -981,7 +978,6 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
/**
|
||||
* Return the string that will be shared into the new-post-editor
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getTextToBeShared() {
|
||||
|
@ -990,10 +986,34 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
/**
|
||||
* Set the string that will be shared into the new-post-editor
|
||||
*
|
||||
* @param textToBeShared
|
||||
*/
|
||||
public void setTextToBeShared(String textToBeShared) {
|
||||
this.textToBeShared = textToBeShared;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyColorToViews() {
|
||||
ThemeHelper.updateToolbarColor(toolbarTop);
|
||||
ThemeHelper.updateActionMenuViewColor(toolbarBottom);
|
||||
navDrawerLayout.setBackgroundColor(appSettings.getPrimaryColor());
|
||||
navProfilePictureArea.setBackgroundColor(appSettings.getPrimaryColor());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableToolbarHiding() {
|
||||
AppLog.d(this, "Enable Intellihide");
|
||||
AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) toolbarTop.getLayoutParams();
|
||||
//scroll|enterAlways|snap
|
||||
params.setScrollFlags(toolbarDefaultScrollFlags);
|
||||
appBarLayout.setExpanded(true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableToolbarHiding() {
|
||||
AppLog.d(this, "Disable Intellihide");
|
||||
AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) toolbarTop.getLayoutParams();
|
||||
params.setScrollFlags(0); // clear all scroll flags
|
||||
appBarLayout.setExpanded(true, true);
|
||||
}
|
||||
}
|
|
@ -1,58 +1,85 @@
|
|||
/*
|
||||
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.activity;
|
||||
|
||||
import android.app.AlarmManager;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.preference.EditTextPreference;
|
||||
import android.preference.ListPreference;
|
||||
import android.preference.Preference;
|
||||
import android.preference.PreferenceFragment;
|
||||
import android.preference.PreferenceScreen;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.design.widget.AppBarLayout;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.FrameLayout;
|
||||
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;
|
||||
import com.github.dfa.diaspora_android.data.DiasporaPodList.DiasporaPod;
|
||||
import com.github.dfa.diaspora_android.ui.IntellihideToolbarActivityListener;
|
||||
import com.github.dfa.diaspora_android.util.AppLog;
|
||||
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 butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import uz.shift.colorpicker.LineColorPicker;
|
||||
import uz.shift.colorpicker.OnColorChangedListener;
|
||||
|
||||
/**
|
||||
* @author vanitas
|
||||
*/
|
||||
public class SettingsActivity extends AppCompatActivity {
|
||||
private boolean activityRestartRequired;
|
||||
public class SettingsActivity extends ThemedActivity implements IntellihideToolbarActivityListener {
|
||||
@BindView(R.id.settings__appbar)
|
||||
protected AppBarLayout appBarLayout;
|
||||
|
||||
@BindView(R.id.settings__toolbar)
|
||||
protected Toolbar toolbar;
|
||||
|
||||
private ProxyHandler.ProxySettings oldProxySettings;
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ActionBar toolbar = getSupportActionBar();
|
||||
if (toolbar != null)
|
||||
toolbar.setDisplayHomeAsUpEnabled(true);
|
||||
getFragmentManager().beginTransaction().replace(android.R.id.content, new SettingsFragment()).commit();
|
||||
setContentView(R.layout.settings__activity);
|
||||
ButterKnife.bind(this);
|
||||
setSupportActionBar(toolbar);
|
||||
toolbar.setNavigationIcon(getResources().getDrawable(R.drawable.ic_arrow_back_white_24px));
|
||||
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
SettingsActivity.this.onBackPressed();
|
||||
}
|
||||
});
|
||||
oldProxySettings = getAppSettings().getProxySettings();
|
||||
getFragmentManager().beginTransaction().replace(R.id.settings__fragment_container, new SettingsFragment()).commit();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -66,8 +93,26 @@ public class SettingsActivity extends AppCompatActivity {
|
|||
}
|
||||
}
|
||||
|
||||
private void setActivityRestartRequired() {
|
||||
this.activityRestartRequired = true;
|
||||
@Override
|
||||
protected void applyColorToViews() {
|
||||
ThemeHelper.updateToolbarColor(toolbar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableToolbarHiding() {
|
||||
AppLog.d(this, "Enable Intellihide");
|
||||
AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) toolbar.getLayoutParams();
|
||||
//scroll|enterAlways|snap
|
||||
params.setScrollFlags(toolbarDefaultScrollFlags);
|
||||
appBarLayout.setExpanded(true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableToolbarHiding() {
|
||||
AppLog.d(this, "Disable Intellihide");
|
||||
AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) toolbar.getLayoutParams();
|
||||
params.setScrollFlags(0); // clear all scroll flags
|
||||
appBarLayout.setExpanded(true, true);
|
||||
}
|
||||
|
||||
public static class SettingsFragment extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
|
@ -81,12 +126,12 @@ public class SettingsActivity extends AppCompatActivity {
|
|||
sharedPreferences.registerOnSharedPreferenceChangeListener(this);
|
||||
setPreferenceSummaries();
|
||||
sharedPreferences.edit().putBoolean(getString(R.string.pref_key__proxy_was_enabled),
|
||||
sharedPreferences.getBoolean(getString(R.string.pref_key__proxy_enabled), false)).apply();
|
||||
sharedPreferences.getBoolean(getString(R.string.pref_key__http_proxy_enabled), false)).apply();
|
||||
}
|
||||
|
||||
private void setPreferenceSummaries() {
|
||||
String[] editTextKeys = new String[]{
|
||||
getString(R.string.pref_key__proxy_host), getString(R.string.pref_key__proxy_port)
|
||||
getString(R.string.pref_key__http_proxy_host), getString(R.string.pref_key__http_proxy_port)
|
||||
};
|
||||
for (String key : editTextKeys) {
|
||||
EditTextPreference p = (EditTextPreference) findPreference(key);
|
||||
|
@ -97,14 +142,12 @@ public class SettingsActivity extends AppCompatActivity {
|
|||
@Override
|
||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
||||
updatePreference(findPreference(key));
|
||||
if (key != null && isAdded() && (key.equals(getString(R.string.pref_key__font_size)) ||
|
||||
key.equals(getString(R.string.pref_key__load_images)) ||
|
||||
key.equals(getString(R.string.pref_key__intellihide_toolbars)) ||
|
||||
key.equals(getString(R.string.pref_key__proxy_enabled)) ||
|
||||
key.equals(getString(R.string.pref_key__proxy_host)) ||
|
||||
key.equals(getString(R.string.pref_key__proxy_port)) ||
|
||||
key.startsWith("pref_key__visibility_nav__"))) {
|
||||
((SettingsActivity) getActivity()).setActivityRestartRequired();
|
||||
if (key.equals(getString(R.string.pref_key__intellihide_toolbars))) {
|
||||
if (sharedPreferences.getBoolean(getString(R.string.pref_key__intellihide_toolbars), false)) {
|
||||
((SettingsActivity) getActivity()).enableToolbarHiding();
|
||||
} else {
|
||||
((SettingsActivity) getActivity()).disableToolbarHiding();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -125,10 +168,31 @@ public class SettingsActivity extends AppCompatActivity {
|
|||
|
||||
@Override
|
||||
public boolean onPreferenceTreeClick(PreferenceScreen screen, Preference preference) {
|
||||
Intent intent = new Intent(getActivity(), MainActivity.class);
|
||||
App app = ((App) getActivity().getApplication());
|
||||
AppSettings appSettings = app.getSettings();
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
if (preference instanceof PreferenceScreen && ((PreferenceScreen) preference).getDialog() != null) {
|
||||
Window window = ((PreferenceScreen) preference).getDialog().getWindow();
|
||||
if (window != null) {
|
||||
window.setStatusBarColor(ThemeHelper.getPrimaryDarkColor());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Intent intent = new Intent(getActivity(), MainActivity.class);
|
||||
DiasporaUrlHelper diasporaUrlHelper = new DiasporaUrlHelper(app.getSettings());
|
||||
|
||||
switch (preference.getTitleRes()) {
|
||||
case R.string.pref_title__primary_color: {
|
||||
showColorPickerDialog(1);
|
||||
intent = null;
|
||||
break;
|
||||
}
|
||||
case R.string.pref_title__accent_color: {
|
||||
showColorPickerDialog(2);
|
||||
intent = null;
|
||||
break;
|
||||
}
|
||||
case R.string.pref_title__personal_settings: {
|
||||
intent.setAction(MainActivity.ACTION_OPEN_URL);
|
||||
intent.putExtra(MainActivity.URL_MESSAGE, diasporaUrlHelper.getPersonalSettingsUrl());
|
||||
|
@ -161,8 +225,13 @@ public class SettingsActivity extends AppCompatActivity {
|
|||
.show();
|
||||
return true;
|
||||
}
|
||||
case R.string.pref_title__clear_cache:
|
||||
{
|
||||
case R.string.pref_title__http_proxy_load_tor_preset: {
|
||||
((EditTextPreference) findPreference(getString(R.string.pref_key__http_proxy_host))).setText("127.0.0.1");
|
||||
((EditTextPreference) findPreference(getString(R.string.pref_key__http_proxy_port))).setText("8118");
|
||||
return true;
|
||||
}
|
||||
|
||||
case R.string.pref_title__clear_cache: {
|
||||
intent.setAction(MainActivity.ACTION_CLEAR_CACHE);
|
||||
break;
|
||||
}
|
||||
|
@ -179,6 +248,72 @@ public class SettingsActivity extends AppCompatActivity {
|
|||
}
|
||||
return super.onPreferenceTreeClick(screen, preference);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a colorPicker Dialog
|
||||
*
|
||||
* @param type 1 -> Primary Color, 2 -> Accent Color
|
||||
*/
|
||||
public void showColorPickerDialog(final int type) {
|
||||
final AppSettings appSettings = ((App) getActivity().getApplication()).getSettings();
|
||||
final Context context = getActivity();
|
||||
|
||||
//Inflate dialog layout
|
||||
LayoutInflater inflater = getActivity().getLayoutInflater();
|
||||
View dialogLayout = inflater.inflate(R.layout.color_picker__dialog, null);
|
||||
final android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(context);
|
||||
builder.setView(dialogLayout);
|
||||
|
||||
final FrameLayout titleBackground = (FrameLayout) dialogLayout.findViewById(R.id.color_picker_dialog__title_background);
|
||||
final TextView title = (TextView) dialogLayout.findViewById(R.id.color_picker_dialog__title);
|
||||
final LineColorPicker base = (LineColorPicker) dialogLayout.findViewById(R.id.color_picker_dialog__base_picker);
|
||||
final LineColorPicker shade = (LineColorPicker) dialogLayout.findViewById(R.id.color_picker_dialog__shade_picker);
|
||||
|
||||
title.setText(type == 1 ? R.string.pref_title__primary_color : R.string.pref_title__accent_color);
|
||||
title.setTextColor(getResources().getColor(R.color.white));
|
||||
final int[] current = (type == 1 ? appSettings.getPrimaryColorSettings() : appSettings.getAccentColorSettings());
|
||||
base.setColors((type == 1 ? ColorPalette.getBaseColors(context) : ColorPalette.getAccentColors(context)));
|
||||
base.setSelectedColor(current[0]);
|
||||
shade.setColors(ColorPalette.getColors(context, current[0]));
|
||||
shade.setSelectedColor(current[1]);
|
||||
titleBackground.setBackgroundColor(shade.getColor());
|
||||
base.setOnColorChangedListener(new OnColorChangedListener() {
|
||||
@Override
|
||||
public void onColorChanged(int i) {
|
||||
AppLog.d(this, "Selected Base color changed: " + i);
|
||||
shade.setColors(ColorPalette.getColors(context, i));
|
||||
titleBackground.setBackgroundColor(i);
|
||||
if (i == current[0]) {
|
||||
shade.setSelectedColor(current[1]);
|
||||
titleBackground.setBackgroundColor(shade.getColor());
|
||||
}
|
||||
}
|
||||
});
|
||||
shade.setOnColorChangedListener(new OnColorChangedListener() {
|
||||
@Override
|
||||
public void onColorChanged(int i) {
|
||||
titleBackground.setBackgroundColor(i);
|
||||
}
|
||||
});
|
||||
|
||||
//Build dialog
|
||||
builder
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
if (type == 1) {
|
||||
appSettings.setPrimaryColorSettings(base.getColor(), shade.getColor());
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
getActivity().getWindow().setStatusBarColor(ThemeHelper.getPrimaryDarkColor());
|
||||
}
|
||||
((ThemedActivity) getActivity()).applyColorToViews();
|
||||
} else {
|
||||
appSettings.setAccentColorSettings(base.getColor(), shade.getColor());
|
||||
}
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -193,11 +328,21 @@ public class SettingsActivity extends AppCompatActivity {
|
|||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
if (activityRestartRequired) {
|
||||
Intent intent = new Intent(this, MainActivity.class);
|
||||
intent.setAction(MainActivity.ACTION_RELOAD_ACTIVITY);
|
||||
startActivity(intent);
|
||||
ProxyHandler.ProxySettings newProxySettings = getAppSettings().getProxySettings();
|
||||
if (!oldProxySettings.equals(newProxySettings)) {
|
||||
AppLog.d(this, "ProxySettings changed.");
|
||||
//Proxy on-off? => Restart app
|
||||
if (oldProxySettings.isEnabled() && !newProxySettings.isEnabled()) {
|
||||
Intent restartActivity = new Intent(SettingsActivity.this, MainActivity.class);
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(SettingsActivity.this, 12374, restartActivity, PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
AlarmManager mgr = (AlarmManager) SettingsActivity.this.getSystemService(Context.ALARM_SERVICE);
|
||||
mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100, pendingIntent);
|
||||
System.exit(0);
|
||||
} //Proxy changed? => Update
|
||||
else {
|
||||
ProxyHandler.getInstance().updateProxySettings(this);
|
||||
}
|
||||
}
|
||||
super.onStop();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
/*
|
||||
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.activity;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.ActivityManager;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.os.Build;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Activity that supports color schemes
|
||||
* Created by vanitas on 06.10.16.
|
||||
*/
|
||||
|
||||
public abstract class ThemedActivity extends AppCompatActivity {
|
||||
|
||||
protected AppSettings getAppSettings() {
|
||||
return ((App)getApplication()).getSettings();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
ThemeHelper.getInstance(getAppSettings());
|
||||
updateStatusBarColor();
|
||||
updateRecentAppColor();
|
||||
applyColorToViews();
|
||||
}
|
||||
protected abstract void applyColorToViews();
|
||||
|
||||
/**
|
||||
* Update color of the status bar
|
||||
*/
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
private void updateStatusBarColor() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
getWindow().setStatusBarColor(ThemeHelper.getPrimaryDarkColor());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update primary color in recent apps overview
|
||||
*/
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
private void updateRecentAppColor(){
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
BitmapDrawable drawable = ((BitmapDrawable) getDrawable(R.drawable.ic_launcher));
|
||||
if(drawable != null) {
|
||||
setTaskDescription(new ActivityManager.TaskDescription(
|
||||
getResources().getString(R.string.app_name),
|
||||
drawable.getBitmap(),
|
||||
getAppSettings().getPrimaryColor()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,19 +1,15 @@
|
|||
/*
|
||||
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.data;
|
||||
|
@ -23,6 +19,7 @@ import android.content.Context;
|
|||
import android.content.SharedPreferences;
|
||||
|
||||
import com.github.dfa.diaspora_android.R;
|
||||
import com.github.dfa.diaspora_android.util.ProxyHandler;
|
||||
import com.github.dfa.diaspora_android.data.DiasporaPodList.DiasporaPod;
|
||||
import com.github.dfa.diaspora_android.data.DiasporaPodList.DiasporaPod.DiasporaPodUrl;
|
||||
|
||||
|
@ -228,7 +225,7 @@ public class AppSettings {
|
|||
@SuppressLint("CommitPrefEdits")
|
||||
public void setProxyEnabled(boolean enabled) {
|
||||
//commit instead of apply because the app is likely to be killed before apply is called.
|
||||
prefApp.edit().putBoolean(context.getString(R.string.pref_key__proxy_enabled), enabled).commit();
|
||||
prefApp.edit().putBoolean(context.getString(R.string.pref_key__http_proxy_enabled), enabled).commit();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -237,7 +234,7 @@ public class AppSettings {
|
|||
* @return whether proxy is enabled or not
|
||||
*/
|
||||
public boolean isProxyEnabled() {
|
||||
return getBoolean(prefApp, R.string.pref_key__proxy_enabled, false);
|
||||
return getBoolean(prefApp, R.string.pref_key__http_proxy_enabled, false);
|
||||
}
|
||||
|
||||
public boolean wasProxyEnabled() {
|
||||
|
@ -261,9 +258,12 @@ public class AppSettings {
|
|||
* @return proxy host
|
||||
*/
|
||||
public String getProxyHost() {
|
||||
return getString(prefApp, R.string.pref_key__proxy_host, "");
|
||||
return getString(prefApp, R.string.pref_key__http_proxy_host, "");
|
||||
}
|
||||
|
||||
public void setProxyHttpHost(String value) {
|
||||
setString(prefApp, R.string.pref_key__http_proxy_host, value);
|
||||
}
|
||||
/**
|
||||
* Default value: 0
|
||||
*
|
||||
|
@ -271,13 +271,21 @@ public class AppSettings {
|
|||
*/
|
||||
public int getProxyPort() {
|
||||
try {
|
||||
return Integer.parseInt(getString(prefApp, R.string.pref_key__proxy_port, "0"));
|
||||
return Integer.parseInt(getString(prefApp, R.string.pref_key__http_proxy_port, "0"));
|
||||
} catch (Exception e) {
|
||||
setString(prefApp, R.string.pref_key__proxy_port, "0");
|
||||
setString(prefApp, R.string.pref_key__http_proxy_port, "0");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void setProxyHttpPort(int value) {
|
||||
setInt(prefApp, R.string.pref_key__http_proxy_port, value);
|
||||
}
|
||||
|
||||
public ProxyHandler.ProxySettings getProxySettings() {
|
||||
return new ProxyHandler.ProxySettings(isProxyEnabled(), getProxyHost(), getProxyPort());
|
||||
}
|
||||
|
||||
public boolean isIntellihideToolbars() {
|
||||
return getBoolean(prefApp, R.string.pref_key__intellihide_toolbars, false);
|
||||
}
|
||||
|
@ -333,4 +341,36 @@ public class AppSettings {
|
|||
public boolean isVisibleInNavProfile() {
|
||||
return getBoolean(prefApp, R.string.pref_key__visibility_nav__profile, false);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPrimaryColorSettings(int base, int shade) {
|
||||
setInt(prefApp, R.string.pref_key__primary_color_base, base);
|
||||
setInt(prefApp, R.string.pref_key__primary_color_shade, shade);
|
||||
}
|
||||
|
||||
public int[] getPrimaryColorSettings() {
|
||||
return new int[]{
|
||||
getInt(prefApp, R.string.pref_key__primary_color_base, context.getResources().getColor(R.color.md_blue_500)),
|
||||
getInt(prefApp, R.string.pref_key__primary_color_shade, context.getResources().getColor(R.color.primary))
|
||||
};
|
||||
}
|
||||
|
||||
public int getPrimaryColor() {
|
||||
return getInt(prefApp, R.string.pref_key__primary_color_shade, context.getResources().getColor(R.color.primary));
|
||||
}
|
||||
|
||||
public void setAccentColorSettings(int base, int shade) {
|
||||
setInt(prefApp, R.string.pref_key__accent_color_base, base);
|
||||
setInt(prefApp, R.string.pref_key__accent_color_shade, shade);
|
||||
}
|
||||
|
||||
public int[] getAccentColorSettings() {
|
||||
return new int[]{
|
||||
getInt(prefApp, R.string.pref_key__accent_color_base, context.getResources().getColor(R.color.md_deep_orange_500)),
|
||||
getInt(prefApp, R.string.pref_key__accent_color_shade, context.getResources().getColor(R.color.accent))
|
||||
};
|
||||
}
|
||||
|
||||
public int getAccentColor() {
|
||||
return getInt(prefApp, R.string.pref_key__accent_color_shade, context.getResources().getColor(R.color.accent));
|
||||
}
|
||||
}
|
|
@ -1,9 +1,24 @@
|
|||
/*
|
||||
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.fragment;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.AlarmManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
|
@ -11,7 +26,6 @@ import android.graphics.Bitmap;
|
|||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.os.StrictMode;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.view.LayoutInflater;
|
||||
|
@ -22,16 +36,17 @@ import android.view.ViewGroup;
|
|||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.Toast;
|
||||
|
||||
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.ProxyHandler;
|
||||
import com.github.dfa.diaspora_android.ui.ContextMenuWebView;
|
||||
import com.github.dfa.diaspora_android.util.theming.ThemeHelper;
|
||||
import com.github.dfa.diaspora_android.util.AppLog;
|
||||
import com.github.dfa.diaspora_android.webview.CustomWebViewClient;
|
||||
import com.github.dfa.diaspora_android.webview.ProgressBarWebChromeClient;
|
||||
import com.github.dfa.diaspora_android.util.AppLog;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
|
@ -42,16 +57,13 @@ import java.text.SimpleDateFormat;
|
|||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
import info.guardianproject.netcipher.NetCipher;
|
||||
import info.guardianproject.netcipher.webkit.WebkitProxy;
|
||||
|
||||
/**
|
||||
* Fragment with a webView and a ProgressBar.
|
||||
* This Fragment retains its instance.
|
||||
* Created by vanitas on 26.09.16.
|
||||
*/
|
||||
|
||||
public class BrowserFragment extends CustomFragment {
|
||||
public class BrowserFragment extends ThemedFragment {
|
||||
public static final String TAG = "com.github.dfa.diaspora_android.BrowserFragment";
|
||||
|
||||
protected View rootLayout;
|
||||
|
@ -84,21 +96,13 @@ public class BrowserFragment extends CustomFragment {
|
|||
if(this.webView == null) {
|
||||
this.webView = (ContextMenuWebView) view.findViewById(R.id.webView);
|
||||
this.applyWebViewSettings();
|
||||
ProxyHandler.getInstance().addWebView(webView);
|
||||
}
|
||||
|
||||
if(this.progressBar == null) {
|
||||
this.progressBar = (ProgressBar) view.findViewById(R.id.progressBar);
|
||||
}
|
||||
|
||||
if (appSettings.isProxyEnabled()) {
|
||||
if (!setProxy(appSettings.getProxyHost(), appSettings.getProxyPort())) {
|
||||
AppLog.e(this, "Could not enable Proxy");
|
||||
Toast.makeText(getContext(), R.string.toast_set_proxy_failed, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else if (appSettings.wasProxyEnabled()) {
|
||||
resetProxy();
|
||||
}
|
||||
|
||||
if(pendingUrl != null) {
|
||||
loadUrl(pendingUrl);
|
||||
pendingUrl = null;
|
||||
|
@ -142,86 +146,15 @@ public class BrowserFragment extends CustomFragment {
|
|||
webView.setWebChromeClient(new ProgressBarWebChromeClient(webView, progressBar));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set proxy according to arguments. host must not be "" or null, port must be positive.
|
||||
* Return true on success and update appSettings' proxy related values.
|
||||
*
|
||||
* @param host proxy host (eg. localhost or 127.0.0.1)
|
||||
* @param port proxy port (eg. 8118)
|
||||
* @return success
|
||||
* @throws IllegalArgumentException if arguments do not fit specifications above
|
||||
*/
|
||||
private boolean setProxy(final String host, final int port) {
|
||||
AppLog.i(this, "StreamFragment.setProxy()");
|
||||
if (host != null && !host.equals("") && port >= 0) {
|
||||
AppLog.i(this, "Set proxy to "+host+":"+port);
|
||||
//Temporary change thread policy
|
||||
AppLog.v(this, "Set temporary ThreadPolicy");
|
||||
StrictMode.ThreadPolicy old = StrictMode.getThreadPolicy();
|
||||
StrictMode.ThreadPolicy tmp = new StrictMode.ThreadPolicy.Builder().permitAll().build();
|
||||
StrictMode.setThreadPolicy(tmp);
|
||||
|
||||
AppLog.v(this, "Apply NetCipher proxy settings");
|
||||
NetCipher.setProxy(host, port); //Proxy for HttpsUrlConnections
|
||||
try {
|
||||
//Proxy for the webview
|
||||
AppLog.v(this, "Apply Webkit proxy settings");
|
||||
WebkitProxy.setProxy(MainActivity.class.getName(), getContext().getApplicationContext(), null, host, port);
|
||||
} catch (Exception e) {
|
||||
AppLog.e(this, "Could not apply WebKit proxy settings:\n"+e.toString());
|
||||
}
|
||||
AppLog.v(this, "Save changes in appSettings");
|
||||
appSettings.setProxyEnabled(true);
|
||||
appSettings.setProxyWasEnabled(true);
|
||||
|
||||
AppLog.v(this, "Reset old ThreadPolicy");
|
||||
StrictMode.setThreadPolicy(old);
|
||||
AppLog.i(this, "Success! Reload WebView");
|
||||
webView.reload();
|
||||
return true;
|
||||
} else {
|
||||
AppLog.e(this, "Invalid proxy configuration. Host: "+host+" Port: "+port+"\nRefuse to set proxy");
|
||||
return false;
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if(webView != null) {
|
||||
webSettings.setMinimumFontSize(appSettings.getMinimumFontSize());
|
||||
webSettings.setLoadsImagesAutomatically(appSettings.isLoadImages());
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private boolean setProxy() {
|
||||
return setProxy(appSettings.getProxyHost(), appSettings.getProxyPort());
|
||||
}
|
||||
|
||||
private void resetProxy() {
|
||||
AppLog.i(this, "StreamFragment.resetProxy()");
|
||||
AppLog.v(this, "write changes to appSettings");
|
||||
appSettings.setProxyEnabled(false);
|
||||
appSettings.setProxyWasEnabled(false);
|
||||
|
||||
//Temporary change thread policy
|
||||
AppLog.v(this, "Set temporary ThreadPolicy");
|
||||
StrictMode.ThreadPolicy old = StrictMode.getThreadPolicy();
|
||||
StrictMode.ThreadPolicy tmp = new StrictMode.ThreadPolicy.Builder().permitAll().build();
|
||||
StrictMode.setThreadPolicy(tmp);
|
||||
|
||||
AppLog.v(this, "clear NetCipher proxy");
|
||||
NetCipher.clearProxy();
|
||||
try {
|
||||
AppLog.v(this, "clear WebKit proxy");
|
||||
WebkitProxy.resetProxy(MainActivity.class.getName(), getContext());
|
||||
} catch (Exception e) {
|
||||
AppLog.e(this, "Could not clear WebKit proxy:\n"+e.toString());
|
||||
}
|
||||
AppLog.v(this, "Reset old ThreadPolicy");
|
||||
StrictMode.setThreadPolicy(old);
|
||||
|
||||
//Restart app
|
||||
AppLog.i(this, "Success! Restart app due to proxy reset");
|
||||
Intent restartActivity = new Intent(getContext(), MainActivity.class);
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(getContext(), 12374, restartActivity, PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
AlarmManager mgr = (AlarmManager) getActivity().getSystemService(Context.ALARM_SERVICE);
|
||||
mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100, pendingIntent);
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
@SuppressWarnings("ResultOfMethodCallIgnored")
|
||||
protected boolean makeScreenshotOfWebView(boolean hasToShareScreenshot) {
|
||||
AppLog.i(this, "StreamFragment.makeScreenshotOfWebView()");
|
||||
|
@ -350,4 +283,9 @@ public class BrowserFragment extends CustomFragment {
|
|||
public ContextMenuWebView getWebView() {
|
||||
return this.webView;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyColorToViews() {
|
||||
ThemeHelper.updateProgressBarColor(progressBar);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
/*
|
||||
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.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
/*
|
||||
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.fragment;
|
||||
|
||||
import android.Manifest;
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
/*
|
||||
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.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
/*
|
||||
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.fragment;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
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.fragment;
|
||||
|
||||
import com.github.dfa.diaspora_android.App;
|
||||
import com.github.dfa.diaspora_android.data.AppSettings;
|
||||
import com.github.dfa.diaspora_android.util.theming.ThemeHelper;
|
||||
|
||||
/**
|
||||
* Fragment that supports color schemes
|
||||
* Created by vanitas on 06.10.16.
|
||||
*/
|
||||
|
||||
public abstract class ThemedFragment extends CustomFragment {
|
||||
protected AppSettings getAppSettings() {
|
||||
return ((App)getActivity().getApplication()).getSettings();
|
||||
}
|
||||
|
||||
protected abstract void applyColorToViews();
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
ThemeHelper.getInstance(getAppSettings());
|
||||
applyColorToViews();
|
||||
}
|
||||
}
|
|
@ -1,3 +1,21 @@
|
|||
/*
|
||||
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.receiver;
|
||||
|
||||
import android.app.Activity;
|
||||
|
@ -15,7 +33,7 @@ import com.github.dfa.diaspora_android.data.AppSettings;
|
|||
import com.github.dfa.diaspora_android.util.AppLog;
|
||||
import com.github.dfa.diaspora_android.util.CustomTabHelpers.BrowserFallback;
|
||||
import com.github.dfa.diaspora_android.util.CustomTabHelpers.CustomTabActivityHelper;
|
||||
import com.github.dfa.diaspora_android.util.Helpers;
|
||||
import com.github.dfa.diaspora_android.util.theming.ThemeHelper;
|
||||
|
||||
/**
|
||||
* BroadcastReceiver that opens links in a Chrome CustomTab
|
||||
|
@ -30,9 +48,10 @@ public class OpenExternalLinkReceiver extends BroadcastReceiver {
|
|||
|
||||
@Override
|
||||
public void onReceive(Context c, Intent receiveIntent) {
|
||||
AppSettings settings = new AppSettings(c);
|
||||
AppSettings appSettings = new AppSettings(c);
|
||||
ThemeHelper.getInstance(appSettings);
|
||||
|
||||
AppLog.v(this, "OpenExternalLinkReceiver.onReceive(): url");
|
||||
AppLog.v(this, "OpenExternalLinkReceiver.onReceive(): url");
|
||||
|
||||
Uri url = null;
|
||||
try {
|
||||
|
@ -43,10 +62,10 @@ public class OpenExternalLinkReceiver extends BroadcastReceiver {
|
|||
return;
|
||||
}
|
||||
|
||||
if (settings.isChromeCustomTabsEnabled()) {
|
||||
if (appSettings.isChromeCustomTabsEnabled()) {
|
||||
// Setup Chrome Custom Tab
|
||||
CustomTabsIntent.Builder customTab = new CustomTabsIntent.Builder();
|
||||
customTab.setToolbarColor(Helpers.getColorFromRessource(c, R.color.colorPrimary));
|
||||
customTab.setToolbarColor(ThemeHelper.getPrimaryColor());
|
||||
customTab.addDefaultShareMenuItem();
|
||||
|
||||
Bitmap backButtonIcon = BitmapFactory.decodeResource(c.getResources(), R.drawable.chrome_custom_tab__back);
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
/*
|
||||
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.receiver;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
/*
|
||||
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.ui;
|
||||
|
||||
import android.content.Context;
|
||||
|
@ -30,7 +48,7 @@ public class BadgeDrawable extends Drawable {
|
|||
float textSize = context.getResources().getDimension(R.dimen.textsize_badge_count);
|
||||
|
||||
badgeBackground = new Paint();
|
||||
badgeBackground.setColor(ContextCompat.getColor(context.getApplicationContext(), R.color.accent));
|
||||
badgeBackground.setColor(ContextCompat.getColor(context.getApplicationContext(), R.color.md_deep_orange_650));
|
||||
badgeBackground.setAntiAlias(true);
|
||||
badgeBackground.setStyle(Paint.Style.FILL);
|
||||
badgeStroke = new Paint();
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
package com.github.dfa.diaspora_android.ui;
|
||||
|
||||
import android.support.design.widget.AppBarLayout;
|
||||
|
||||
/**
|
||||
* interface that adds options to control intellihide of toolbars to the Activity
|
||||
* Created by vanitas on 08.10.16.
|
||||
*/
|
||||
|
||||
public interface IntellihideToolbarActivityListener {
|
||||
int toolbarDefaultScrollFlags = AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS | AppBarLayout.LayoutParams.SCROLL_FLAG_SNAP;
|
||||
void enableToolbarHiding();
|
||||
void disableToolbarHiding();
|
||||
}
|
|
@ -1,3 +1,21 @@
|
|||
/*
|
||||
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;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
/*
|
||||
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.CustomTabHelpers;
|
||||
|
||||
import android.app.Activity;
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
/*
|
||||
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.CustomTabHelpers;
|
||||
|
||||
import android.app.Activity;
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
/*
|
||||
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.CustomTabHelpers;
|
||||
|
||||
import android.content.Context;
|
||||
|
|
|
@ -114,6 +114,10 @@ public class Helpers {
|
|||
return "#" + Integer.toHexString(context.getResources().getColor(idColor) & 0x00ffffff);
|
||||
}
|
||||
|
||||
public static String colorToHex(int color) {
|
||||
return "#" + Integer.toHexString(color & 0x00ffffff);
|
||||
}
|
||||
|
||||
public static void printBundle(Bundle savedInstanceState, String k) {
|
||||
if (savedInstanceState != null) {
|
||||
for (String key : savedInstanceState.keySet()) {
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
/*
|
||||
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;
|
||||
|
|
|
@ -0,0 +1,135 @@
|
|||
/*
|
||||
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 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 java.util.ArrayList;
|
||||
|
||||
import info.guardianproject.netcipher.NetCipher;
|
||||
import info.guardianproject.netcipher.webkit.WebkitProxy;
|
||||
|
||||
/**
|
||||
* Proxy Handler that applies proxy settings of the app to webviews etc.
|
||||
* Created by vanitas on 10.10.16.
|
||||
*/
|
||||
|
||||
public class ProxyHandler {
|
||||
private static ProxyHandler instance;
|
||||
private ArrayList<WebView> webViews;
|
||||
|
||||
|
||||
private ProxyHandler() {
|
||||
/* Singleton, yo? */
|
||||
this.webViews = new ArrayList<>();
|
||||
}
|
||||
|
||||
public static ProxyHandler getInstance() {
|
||||
if(instance == null) {
|
||||
instance = new ProxyHandler();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void updateProxySettings(Context context) {
|
||||
AppLog.d(this, "UpdateProxySettings()");
|
||||
AppSettings appSettings = new AppSettings(context);
|
||||
StrictMode.ThreadPolicy old = StrictMode.getThreadPolicy();
|
||||
StrictMode.ThreadPolicy tmp = new StrictMode.ThreadPolicy.Builder().permitAll().build();
|
||||
StrictMode.setThreadPolicy(tmp);
|
||||
if (appSettings.isProxyEnabled()) {
|
||||
//Update NetCipher
|
||||
NetCipher.setProxy(appSettings.getProxyHost(), appSettings.getProxyPort());
|
||||
//Update webviews
|
||||
for (WebView wv : webViews) {
|
||||
if (wv != null) {
|
||||
try {
|
||||
WebkitProxy.setProxy(MainActivity.class.getName(), context.getApplicationContext(), wv, appSettings.getProxyHost(), appSettings.getProxyPort());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
StrictMode.setThreadPolicy(old);
|
||||
}
|
||||
|
||||
public void addWebView(WebView wv) {
|
||||
AppLog.d(this, "AddWebView");
|
||||
if(wv != null && !webViews.contains(wv)) {
|
||||
webViews.add(wv);
|
||||
updateWebViewProxySettings(wv, wv.getContext());
|
||||
}
|
||||
}
|
||||
|
||||
private void updateWebViewProxySettings(WebView wv, Context context) {
|
||||
AppLog.d(this, "UpdateWebViewProxySettings()");
|
||||
AppSettings appSettings = new AppSettings(context);
|
||||
StrictMode.ThreadPolicy old = StrictMode.getThreadPolicy();
|
||||
StrictMode.ThreadPolicy tmp = new StrictMode.ThreadPolicy.Builder().permitAll().build();
|
||||
StrictMode.setThreadPolicy(tmp);
|
||||
if(appSettings.isProxyEnabled()) {
|
||||
if (wv != null) {
|
||||
try {
|
||||
WebkitProxy.setProxy(MainActivity.class.getName(), context.getApplicationContext(), wv, appSettings.getProxyHost(), appSettings.getProxyPort());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
StrictMode.setThreadPolicy(old);
|
||||
}
|
||||
|
||||
public static class ProxySettings {
|
||||
private final boolean enabled;
|
||||
private final String host;
|
||||
private final int port;
|
||||
|
||||
public ProxySettings(boolean enabled, String host, int port) {
|
||||
this.enabled = enabled;
|
||||
this.host = host;
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public String getHost() {
|
||||
return host;
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
return (other instanceof ProxySettings) &&
|
||||
enabled == ((ProxySettings) other).isEnabled() &&
|
||||
host.equals(((ProxySettings) other).getHost()) &&
|
||||
port == ((ProxySettings) other).getPort();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,288 @@
|
|||
package com.github.dfa.diaspora_android.util.theming;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.graphics.ColorUtils;
|
||||
|
||||
import com.github.dfa.diaspora_android.R;
|
||||
|
||||
/**
|
||||
* Created by dnld on 24/02/16.
|
||||
*/
|
||||
public class ColorPalette {
|
||||
|
||||
public static int[] getAccentColors(Context context){
|
||||
return new int[]{
|
||||
ContextCompat.getColor(context, R.color.md_red_500),
|
||||
ContextCompat.getColor(context, R.color.md_purple_500),
|
||||
ContextCompat.getColor(context, R.color.md_deep_purple_500),
|
||||
ContextCompat.getColor(context, R.color.md_blue_500),
|
||||
ContextCompat.getColor(context, R.color.md_light_blue_500),
|
||||
ContextCompat.getColor(context, R.color.md_cyan_500),
|
||||
ContextCompat.getColor(context, R.color.md_teal_500),
|
||||
ContextCompat.getColor(context, R.color.md_green_500),
|
||||
ContextCompat.getColor(context, R.color.md_yellow_500),
|
||||
ContextCompat.getColor(context, R.color.md_orange_500),
|
||||
ContextCompat.getColor(context, R.color.md_deep_orange_500),
|
||||
ContextCompat.getColor(context, R.color.md_brown_500),
|
||||
ContextCompat.getColor(context, R.color.md_blue_grey_500),
|
||||
};
|
||||
}
|
||||
|
||||
public static int getObscuredColor(int c){
|
||||
float[] hsv = new float[3];
|
||||
int color = c;
|
||||
Color.colorToHSV(color, hsv);
|
||||
hsv[2] *= 0.85f; // value component
|
||||
color = Color.HSVToColor(hsv);
|
||||
return color;
|
||||
}
|
||||
|
||||
public static int getTransparentColor(int color, int alpha){
|
||||
return ColorUtils.setAlphaComponent(color, alpha);
|
||||
}
|
||||
|
||||
public static int[] getTransparencyShadows(int color) {
|
||||
int[] shadows = new int[10];
|
||||
for (int i=0; i<10;i++)
|
||||
shadows[i]= (ColorPalette.getTransparentColor(color, ((100-(i*10))*255) /100));
|
||||
return shadows;
|
||||
}
|
||||
|
||||
public static int[] getBaseColors(Context context) {
|
||||
return new int[]{
|
||||
ContextCompat.getColor(context, R.color.md_red_500),
|
||||
ContextCompat.getColor(context, R.color.md_pink_500),
|
||||
ContextCompat.getColor(context, R.color.md_purple_500),
|
||||
ContextCompat.getColor(context, R.color.md_deep_purple_500),
|
||||
ContextCompat.getColor(context, R.color.md_indigo_500),
|
||||
ContextCompat.getColor(context, R.color.md_blue_500),
|
||||
ContextCompat.getColor(context, R.color.md_light_blue_500),
|
||||
ContextCompat.getColor(context, R.color.md_cyan_500),
|
||||
ContextCompat.getColor(context, R.color.md_teal_500),
|
||||
ContextCompat.getColor(context, R.color.md_green_500),
|
||||
ContextCompat.getColor(context, R.color.md_light_green_500),
|
||||
ContextCompat.getColor(context, R.color.md_lime_500),
|
||||
ContextCompat.getColor(context, R.color.md_yellow_500),
|
||||
ContextCompat.getColor(context, R.color.md_amber_500),
|
||||
ContextCompat.getColor(context, R.color.md_orange_500),
|
||||
ContextCompat.getColor(context, R.color.md_deep_orange_500),
|
||||
ContextCompat.getColor(context, R.color.md_brown_500),
|
||||
ContextCompat.getColor(context, R.color.md_blue_grey_500),
|
||||
ContextCompat.getColor(context, R.color.md_grey_500)
|
||||
};
|
||||
}
|
||||
|
||||
public static int[] getColors(Context context, int c) {
|
||||
if (c == ContextCompat.getColor(context, R.color.md_red_500)) {
|
||||
return new int[]{
|
||||
ContextCompat.getColor(context, R.color.md_red_200),
|
||||
ContextCompat.getColor(context, R.color.md_red_300),
|
||||
ContextCompat.getColor(context, R.color.md_red_400),
|
||||
ContextCompat.getColor(context, R.color.md_red_500),
|
||||
ContextCompat.getColor(context, R.color.md_red_600),
|
||||
ContextCompat.getColor(context, R.color.md_red_700),
|
||||
ContextCompat.getColor(context, R.color.md_red_800),
|
||||
ContextCompat.getColor(context, R.color.md_red_900)
|
||||
};
|
||||
} else if (c == ContextCompat.getColor(context, R.color.md_pink_500)) {
|
||||
return new int[]{
|
||||
ContextCompat.getColor(context, R.color.md_pink_200),
|
||||
ContextCompat.getColor(context, R.color.md_pink_300),
|
||||
ContextCompat.getColor(context, R.color.md_pink_400),
|
||||
ContextCompat.getColor(context, R.color.md_pink_500),
|
||||
ContextCompat.getColor(context, R.color.md_pink_600),
|
||||
ContextCompat.getColor(context, R.color.md_pink_700),
|
||||
ContextCompat.getColor(context, R.color.md_pink_800),
|
||||
ContextCompat.getColor(context, R.color.md_pink_900)
|
||||
};
|
||||
} else if (c == ContextCompat.getColor(context, R.color.md_purple_500)) {
|
||||
return new int[]{
|
||||
ContextCompat.getColor(context, R.color.md_purple_200),
|
||||
ContextCompat.getColor(context, R.color.md_purple_300),
|
||||
ContextCompat.getColor(context, R.color.md_purple_400),
|
||||
ContextCompat.getColor(context, R.color.md_purple_500),
|
||||
ContextCompat.getColor(context, R.color.md_purple_600),
|
||||
ContextCompat.getColor(context, R.color.md_purple_700),
|
||||
ContextCompat.getColor(context, R.color.md_purple_800),
|
||||
ContextCompat.getColor(context, R.color.md_purple_900)
|
||||
};
|
||||
} else if (c == ContextCompat.getColor(context, R.color.md_deep_purple_500)) {
|
||||
return new int[]{
|
||||
ContextCompat.getColor(context, R.color.md_deep_purple_200),
|
||||
ContextCompat.getColor(context, R.color.md_deep_purple_300),
|
||||
ContextCompat.getColor(context, R.color.md_deep_purple_400),
|
||||
ContextCompat.getColor(context, R.color.md_deep_purple_500),
|
||||
ContextCompat.getColor(context, R.color.md_deep_purple_600),
|
||||
ContextCompat.getColor(context, R.color.md_deep_purple_700),
|
||||
ContextCompat.getColor(context, R.color.md_deep_purple_800),
|
||||
ContextCompat.getColor(context, R.color.md_deep_purple_900)
|
||||
};
|
||||
} else if (c == ContextCompat.getColor(context, R.color.md_indigo_500)) {
|
||||
return new int[]{
|
||||
ContextCompat.getColor(context, R.color.md_indigo_200),
|
||||
ContextCompat.getColor(context, R.color.md_indigo_300),
|
||||
ContextCompat.getColor(context, R.color.md_indigo_400),
|
||||
ContextCompat.getColor(context, R.color.md_indigo_500),
|
||||
ContextCompat.getColor(context, R.color.md_indigo_600),
|
||||
ContextCompat.getColor(context, R.color.md_indigo_700),
|
||||
ContextCompat.getColor(context, R.color.md_indigo_800),
|
||||
ContextCompat.getColor(context, R.color.md_indigo_900)
|
||||
};
|
||||
} else if (c == ContextCompat.getColor(context, R.color.md_blue_500)) {
|
||||
return new int[]{
|
||||
ContextCompat.getColor(context, R.color.md_blue_200),
|
||||
ContextCompat.getColor(context, R.color.md_blue_300),
|
||||
ContextCompat.getColor(context, R.color.md_blue_400),
|
||||
ContextCompat.getColor(context, R.color.md_blue_500),
|
||||
ContextCompat.getColor(context, R.color.md_blue_600),
|
||||
ContextCompat.getColor(context, R.color.md_blue_650),
|
||||
ContextCompat.getColor(context, R.color.md_blue_700),
|
||||
ContextCompat.getColor(context, R.color.md_blue_750),
|
||||
ContextCompat.getColor(context, R.color.md_blue_800),
|
||||
ContextCompat.getColor(context, R.color.md_blue_900)
|
||||
};
|
||||
} else if (c == ContextCompat.getColor(context, R.color.md_light_blue_500)) {
|
||||
return new int[]{
|
||||
ContextCompat.getColor(context, R.color.md_light_blue_200),
|
||||
ContextCompat.getColor(context, R.color.md_light_blue_300),
|
||||
ContextCompat.getColor(context, R.color.md_light_blue_400),
|
||||
ContextCompat.getColor(context, R.color.md_light_blue_500),
|
||||
ContextCompat.getColor(context, R.color.md_light_blue_600),
|
||||
ContextCompat.getColor(context, R.color.md_light_blue_700),
|
||||
ContextCompat.getColor(context, R.color.md_light_blue_800),
|
||||
ContextCompat.getColor(context, R.color.md_light_blue_900)
|
||||
};
|
||||
} else if (c == ContextCompat.getColor(context, R.color.md_cyan_500)) {
|
||||
return new int[]{
|
||||
ContextCompat.getColor(context, R.color.md_cyan_200),
|
||||
ContextCompat.getColor(context, R.color.md_cyan_300),
|
||||
ContextCompat.getColor(context, R.color.md_cyan_400),
|
||||
ContextCompat.getColor(context, R.color.md_cyan_500),
|
||||
ContextCompat.getColor(context, R.color.md_cyan_600),
|
||||
ContextCompat.getColor(context, R.color.md_cyan_700),
|
||||
ContextCompat.getColor(context, R.color.md_cyan_800),
|
||||
ContextCompat.getColor(context, R.color.md_cyan_900)
|
||||
};
|
||||
} else if (c == ContextCompat.getColor(context, R.color.md_teal_500)) {
|
||||
return new int[]{
|
||||
ContextCompat.getColor(context, R.color.md_teal_200),
|
||||
ContextCompat.getColor(context, R.color.md_teal_300),
|
||||
ContextCompat.getColor(context, R.color.md_teal_400),
|
||||
ContextCompat.getColor(context, R.color.md_teal_500),
|
||||
ContextCompat.getColor(context, R.color.md_teal_600),
|
||||
ContextCompat.getColor(context, R.color.md_teal_700),
|
||||
ContextCompat.getColor(context, R.color.md_teal_800),
|
||||
ContextCompat.getColor(context, R.color.md_teal_900)
|
||||
};
|
||||
} else if (c == ContextCompat.getColor(context, R.color.md_green_500)) {
|
||||
return new int[]{
|
||||
ContextCompat.getColor(context, R.color.md_green_200),
|
||||
ContextCompat.getColor(context, R.color.md_green_300),
|
||||
ContextCompat.getColor(context, R.color.md_green_400),
|
||||
ContextCompat.getColor(context, R.color.md_green_500),
|
||||
ContextCompat.getColor(context, R.color.md_green_600),
|
||||
ContextCompat.getColor(context, R.color.md_green_700),
|
||||
ContextCompat.getColor(context, R.color.md_green_800),
|
||||
ContextCompat.getColor(context, R.color.md_green_900)
|
||||
};
|
||||
} else if (c == ContextCompat.getColor(context, R.color.md_light_green_500)) {
|
||||
return new int[]{
|
||||
ContextCompat.getColor(context, R.color.md_light_green_200),
|
||||
ContextCompat.getColor(context, R.color.md_light_green_300),
|
||||
ContextCompat.getColor(context, R.color.md_light_green_400),
|
||||
ContextCompat.getColor(context, R.color.md_light_green_500),
|
||||
ContextCompat.getColor(context, R.color.md_light_green_600),
|
||||
ContextCompat.getColor(context, R.color.md_light_green_700),
|
||||
ContextCompat.getColor(context, R.color.md_light_green_800),
|
||||
ContextCompat.getColor(context, R.color.md_light_green_900)
|
||||
};
|
||||
} else if (c == ContextCompat.getColor(context, R.color.md_lime_500)) {
|
||||
return new int[]{
|
||||
ContextCompat.getColor(context, R.color.md_lime_200),
|
||||
ContextCompat.getColor(context, R.color.md_lime_300),
|
||||
ContextCompat.getColor(context, R.color.md_lime_400),
|
||||
ContextCompat.getColor(context, R.color.md_lime_500),
|
||||
ContextCompat.getColor(context, R.color.md_lime_600),
|
||||
ContextCompat.getColor(context, R.color.md_lime_700),
|
||||
ContextCompat.getColor(context, R.color.md_lime_800),
|
||||
ContextCompat.getColor(context, R.color.md_lime_900)
|
||||
};
|
||||
} else if (c == ContextCompat.getColor(context, R.color.md_yellow_500)) {
|
||||
return new int[]{
|
||||
ContextCompat.getColor(context, R.color.md_yellow_400),
|
||||
ContextCompat.getColor(context, R.color.md_yellow_500),
|
||||
ContextCompat.getColor(context, R.color.md_yellow_600),
|
||||
ContextCompat.getColor(context, R.color.md_yellow_700),
|
||||
ContextCompat.getColor(context, R.color.md_yellow_800),
|
||||
ContextCompat.getColor(context, R.color.md_yellow_900)
|
||||
};
|
||||
} else if (c == ContextCompat.getColor(context, R.color.md_amber_500)) {
|
||||
return new int[]{
|
||||
ContextCompat.getColor(context, R.color.md_amber_200),
|
||||
ContextCompat.getColor(context, R.color.md_amber_300),
|
||||
ContextCompat.getColor(context, R.color.md_amber_400),
|
||||
ContextCompat.getColor(context, R.color.md_amber_500),
|
||||
ContextCompat.getColor(context, R.color.md_amber_600),
|
||||
ContextCompat.getColor(context, R.color.md_amber_700),
|
||||
ContextCompat.getColor(context, R.color.md_amber_800),
|
||||
ContextCompat.getColor(context, R.color.md_amber_900)
|
||||
};
|
||||
} else if (c == ContextCompat.getColor(context, R.color.md_orange_500)) {
|
||||
return new int[]{
|
||||
ContextCompat.getColor(context, R.color.md_orange_200),
|
||||
ContextCompat.getColor(context, R.color.md_orange_300),
|
||||
ContextCompat.getColor(context, R.color.md_orange_400),
|
||||
ContextCompat.getColor(context, R.color.md_orange_500),
|
||||
ContextCompat.getColor(context, R.color.md_orange_600),
|
||||
ContextCompat.getColor(context, R.color.md_orange_700),
|
||||
ContextCompat.getColor(context, R.color.md_orange_800),
|
||||
ContextCompat.getColor(context, R.color.md_orange_900)
|
||||
};
|
||||
} else if (c == ContextCompat.getColor(context, R.color.md_deep_orange_500)) {
|
||||
return new int[]{
|
||||
ContextCompat.getColor(context, R.color.md_deep_orange_200),
|
||||
ContextCompat.getColor(context, R.color.md_deep_orange_300),
|
||||
ContextCompat.getColor(context, R.color.md_deep_orange_400),
|
||||
ContextCompat.getColor(context, R.color.md_deep_orange_500),
|
||||
ContextCompat.getColor(context, R.color.md_deep_orange_600),
|
||||
ContextCompat.getColor(context, R.color.md_deep_orange_650),
|
||||
ContextCompat.getColor(context, R.color.md_deep_orange_700),
|
||||
ContextCompat.getColor(context, R.color.md_deep_orange_800),
|
||||
ContextCompat.getColor(context, R.color.md_deep_orange_900)
|
||||
};
|
||||
} else if (c == ContextCompat.getColor(context, R.color.md_brown_500)) {
|
||||
return new int[]{
|
||||
ContextCompat.getColor(context, R.color.md_brown_200),
|
||||
ContextCompat.getColor(context, R.color.md_brown_300),
|
||||
ContextCompat.getColor(context, R.color.md_brown_400),
|
||||
ContextCompat.getColor(context, R.color.md_brown_500),
|
||||
ContextCompat.getColor(context, R.color.md_brown_600),
|
||||
ContextCompat.getColor(context, R.color.md_brown_700),
|
||||
ContextCompat.getColor(context, R.color.md_brown_800),
|
||||
ContextCompat.getColor(context, R.color.md_brown_900)
|
||||
};
|
||||
} else if (c == ContextCompat.getColor(context, R.color.md_grey_500)) {
|
||||
return new int[]{
|
||||
ContextCompat.getColor(context, R.color.md_grey_400),
|
||||
ContextCompat.getColor(context, R.color.md_grey_500),
|
||||
ContextCompat.getColor(context, R.color.md_grey_600),
|
||||
ContextCompat.getColor(context, R.color.md_grey_700),
|
||||
ContextCompat.getColor(context, R.color.md_grey_800),
|
||||
ContextCompat.getColor(context, R.color.md_grey_900),
|
||||
Color.parseColor("#000000")
|
||||
};
|
||||
} else {
|
||||
return new int[]{
|
||||
ContextCompat.getColor(context, R.color.md_blue_grey_300),
|
||||
ContextCompat.getColor(context, R.color.md_blue_grey_400),
|
||||
ContextCompat.getColor(context, R.color.md_blue_grey_500),
|
||||
ContextCompat.getColor(context, R.color.md_blue_grey_600),
|
||||
ContextCompat.getColor(context, R.color.md_blue_grey_700),
|
||||
ContextCompat.getColor(context, R.color.md_blue_grey_800),
|
||||
ContextCompat.getColor(context, R.color.md_blue_grey_900)
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,128 @@
|
|||
/*
|
||||
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/>.
|
||||
This class is inspired by org.horasapps.LeafPic
|
||||
*/
|
||||
package com.github.dfa.diaspora_android.util.theming;
|
||||
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.support.design.widget.TabLayout;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.widget.ActionMenuView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.View;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.github.dfa.diaspora_android.data.AppSettings;
|
||||
|
||||
/**
|
||||
* Singleton that can be used to color views
|
||||
* Created by vanitas on 06.10.16.
|
||||
*/
|
||||
|
||||
public class ThemeHelper {
|
||||
private AppSettings appSettings;
|
||||
private static ThemeHelper instance;
|
||||
|
||||
private ThemeHelper(AppSettings appSettings) {
|
||||
this.appSettings = appSettings;
|
||||
}
|
||||
|
||||
public static ThemeHelper getInstance(AppSettings appSettings) {
|
||||
if(instance == null) {
|
||||
instance = new ThemeHelper(appSettings);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static ThemeHelper getInstance() {
|
||||
if(instance == null) throw new IllegalStateException("ThemeHelper must be initialized using getInstance(AppSettings) before it can be used!");
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static void updateEditTextColor(EditText editText) {
|
||||
if(editText != null) {
|
||||
editText.setHighlightColor(getInstance().appSettings.getAccentColor());
|
||||
}
|
||||
}
|
||||
|
||||
public static void updateCheckBoxColor(CheckBox checkBox) {
|
||||
if(checkBox != null) {
|
||||
checkBox.setHighlightColor(getInstance().appSettings.getAccentColor());
|
||||
}
|
||||
}
|
||||
|
||||
public static void updateTabLayoutColor(TabLayout tabLayout) {
|
||||
if(tabLayout != null) {
|
||||
tabLayout.setBackgroundColor(getInstance().appSettings.getPrimaryColor());
|
||||
tabLayout.setSelectedTabIndicatorColor(getInstance().appSettings.getAccentColor());
|
||||
}
|
||||
}
|
||||
|
||||
public static void updateTextViewColor(TextView textView) {
|
||||
if(textView != null) {
|
||||
textView.setHighlightColor(getInstance().appSettings.getAccentColor());
|
||||
textView.setLinkTextColor(getInstance().appSettings.getAccentColor());
|
||||
}
|
||||
}
|
||||
|
||||
public static void updateToolbarColor(Toolbar toolbar) {
|
||||
if(toolbar != null) {
|
||||
toolbar.setBackgroundColor(getInstance().appSettings.getPrimaryColor());
|
||||
}
|
||||
}
|
||||
|
||||
public static void updateActionMenuViewColor(ActionMenuView actionMenuView) {
|
||||
if(actionMenuView != null) {
|
||||
actionMenuView.setBackgroundColor(getInstance().appSettings.getPrimaryColor());
|
||||
}
|
||||
}
|
||||
|
||||
public static int getPrimaryColor() {
|
||||
return getInstance().appSettings.getPrimaryColor();
|
||||
}
|
||||
|
||||
public static int getAccentColor() {
|
||||
return getInstance().appSettings.getAccentColor();
|
||||
}
|
||||
|
||||
public static void setPrimaryColorAsBackground(View view) {
|
||||
if(view != null) {
|
||||
view.setBackgroundColor(getPrimaryColor());
|
||||
}
|
||||
}
|
||||
|
||||
public static int getPrimaryDarkColor() {
|
||||
return ColorPalette.getObscuredColor(getPrimaryColor());
|
||||
}
|
||||
|
||||
public static void updateActionBarColor(ActionBar actionBar) {
|
||||
if(actionBar != null) {
|
||||
actionBar.setBackgroundDrawable(new ColorDrawable(getInstance().appSettings.getPrimaryColor()));
|
||||
}
|
||||
}
|
||||
|
||||
public static void updateProgressBarColor(ProgressBar progressBar) {
|
||||
if(progressBar != null && progressBar.getProgressDrawable() != null) {
|
||||
progressBar.getProgressDrawable().setColorFilter(getAccentColor(), PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,3 +1,21 @@
|
|||
/*
|
||||
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.webview;
|
||||
|
||||
import android.webkit.WebView;
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
/*
|
||||
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.webview;
|
||||
|
||||
import android.net.Uri;
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
/*
|
||||
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.webview;
|
||||
|
||||
import android.view.View;
|
||||
|
|
|
@ -1,5 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@android:id/progress">
|
||||
<clip>
|
||||
<shape>
|
||||
<solid android:color="@color/white"/>
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
|
||||
<!-- Old progressbar
|
||||
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<solid android:color="@color/colorPrimaryDark"/>
|
||||
|
@ -12,4 +22,6 @@
|
|||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
|
||||
-->
|
||||
</layer-list>
|
13
app/src/main/res/drawable/tor_onion.xml
Normal file
13
app/src/main/res/drawable/tor_onion.xml
Normal file
|
@ -0,0 +1,13 @@
|
|||
<vector android:height="24dp" android:viewportHeight="185.0"
|
||||
android:viewportWidth="185.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#abcd03" android:pathData="m103.9,14.01 l-4.92,19.53c6.97,-13.79 18.03,-24.17 30.73,-33.32 -9.29,10.79 -17.75,21.58 -22.94,32.37 8.74,-12.29 20.49,-19.12 33.73,-23.63 -17.62,15.71 -31.6,32.56 -42.26,49.49l-8.47,-3.69c1.5,-13.52 6.61,-27.37 14.12,-40.75z"/>
|
||||
<path android:fillColor="#fffcdb" android:pathData="m81.29,51.17 l16.12,6.69c0,4.1 -0.33,16.6 2.23,20.28 26.8,34.52 22.29,103.71 -5.43,105.49 -42.22,0 -58.32,-28.68 -58.32,-55.04 0,-24.04 28.82,-40.02 46.03,-54.22 4.37,-3.82 3.61,-12.28 -0.62,-23.2z"/>
|
||||
<path android:fillColor="#7d4698" android:pathData="m97.41,57.62 l5.81,2.96c-0.55,3.82 0.27,12.29 4.1,14.48 16.94,10.52 32.91,21.99 39.2,33.46 22.4,40.43 -15.71,77.85 -48.62,74.3 17.89,-13.25 23.08,-40.43 16.39,-70.06 -2.73,-11.61 -6.97,-22.13 -14.48,-34.01 -3.25,-5.83 -2.12,-13.07 -2.39,-21.12z"/>
|
||||
<path android:fillColor="#FF000000" android:pathData="m94.61,56.62 l12.02,1.64c-3.55,11.74 6.97,19.94 10.38,21.85 7.65,4.23 15.02,8.6 20.9,13.93 11.06,10.11 17.34,24.31 17.34,39.33 0,14.89 -6.83,29.23 -18.3,38.79 -10.79,9.01 -25.68,12.84 -40.15,12.84 -9.01,0 -17.07,-0.41 -25.81,-3.28 -19.94,-6.69 -34.83,-23.76 -36.06,-44.25 -1.09,-15.98 2.46,-28.13 14.89,-40.83 6.42,-6.69 19.39,-14.34 28.27,-20.49 4.37,-3.01 9.01,-11.47 0.14,-27.45l1.78,-1.37 13.16,8.81 -11.11,-4.58c0.96,1.37 3.55,7.51 4.1,9.29 1.23,5.05 0.68,9.97 -0.41,12.15 -5.6,10.11 -15.16,12.84 -22.12,18.57 -12.29,10.11 -25.68,18.16 -24.17,45.89 0.68,13.66 11.34,30.32 27.31,38.1 9.01,4.37 19.39,6.15 29.91,6.69 9.42,0.41 27.45,-5.19 37.28,-13.38 10.52,-8.74 16.39,-21.99 16.39,-35.51 0,-13.66 -5.46,-26.63 -15.71,-35.78 -5.87,-5.33 -15.57,-11.74 -21.58,-15.16 -6.01,-3.41 -13.52,-12.97 -11.06,-22.12z"/>
|
||||
<path android:fillColor="#FF000000" android:pathData="m90.93,76.84c-1.23,6.28 -2.6,17.62 -8.06,21.85 -2.32,1.64 -4.64,3.28 -7.1,4.92 -9.83,6.69 -19.67,12.97 -24.17,29.09 -0.96,3.41 -0.14,7.1 0.68,10.52 2.46,9.83 9.42,20.49 14.89,26.77 0,0.27 1.09,0.96 1.09,1.23 4.51,5.33 5.87,6.83 22.94,10.65l-0.41,1.91c-10.24,-2.73 -18.71,-5.19 -24.04,-11.34 0,-0.14 -0.96,-1.09 -0.96,-1.09 -5.74,-6.56 -12.7,-17.48 -15.3,-27.72 -0.96,-4.1 -1.77,-7.24 -0.68,-11.47 4.64,-16.66 14.75,-23.22 24.99,-30.18 2.32,-1.5 5.05,-2.87 7.24,-4.64 4.23,-3.14 6.55,-12.7 8.88,-20.49z"/>
|
||||
<path android:fillColor="#FF000000" android:pathData="m95.29,102.78c0.14,7.1 -0.56,10.66 1.22,15.72 1.09,3 4.78,7.1 5.88,11.06 1.5,5.33 3.14,11.2 3,14.75 0,4.1 -0.26,11.74 -2.03,19.94 -1.35,6.77 -4.47,12.58 -9.72,15.88 -5.37,-1.11 -11.68,-3 -15.41,-6.19 -7.24,-6.28 -13.65,-16.79 -14.47,-25.94 -0.68,-7.51 6.27,-18.59 15.97,-24.19 8.19,-4.78 10.1,-10.23 11.88,-18.97 -2.46,7.65 -4.77,14.06 -12.69,18.16 -11.47,6.01 -17.36,16.1 -16.81,25.66 0.82,12.29 5.74,20.62 15.44,27.31 4.1,2.87 11.75,5.9 16.53,6.72l0,-0.63c3.62,-0.68 8.32,-6.63 10.66,-14.69 2.05,-7.24 2.86,-16.5 2.72,-22.37 -0.14,-3.41 -1.64,-10.81 -4.38,-17.5 -1.5,-3.69 -3.81,-7.37 -5.31,-9.97 -1.64,-2.6 -1.65,-8.19 -2.47,-14.75z"/>
|
||||
<path android:fillColor="#FF000000" android:pathData="m94.48,129.56c0.14,4.78 2.06,10.9 2.88,17.19 0.68,4.64 0.39,9.31 0.25,13.41 -0.13,4.74 -1.72,13.24 -3.88,17.38 -2.04,-0.93 -2.83,-2 -4.16,-3.72 -1.64,-2.32 -2.75,-4.64 -3.84,-7.38 -0.82,-2.05 -1.78,-4.39 -2.19,-7.13 -0.55,-4.1 -0.39,-10.51 4.25,-17.06 3.55,-5.19 4.36,-5.58 5.59,-11.59 -1.64,5.33 -2.86,5.87 -6.69,10.38 -4.23,4.92 -4.94,12.16 -4.94,18.03 0,2.46 0.98,5.19 1.94,7.78 1.09,2.73 2.03,5.45 3.53,7.5 2.26,3.32 5.15,5.21 6.56,5.56 0.01,0 0.02,-0 0.03,0 0.03,0.01 0.06,0.03 0.09,0.03l0,-0.16c2.65,-2.95 4.24,-5.89 4.78,-8.84 0.68,-3.55 0.84,-7.11 1.25,-11.34 0.41,-3.55 0.11,-8.33 -0.84,-13.25 -1.37,-6.15 -3.67,-12.41 -4.63,-16.78z"/>
|
||||
<path android:fillColor="#FF000000" android:pathData="m94.89,71.1c0.14,7.1 0.68,20.35 2.6,25.54 0.55,1.77 5.6,9.56 9.15,18.98 2.46,6.56 3.01,12.56 3.41,14.34 1.64,7.78 -0.41,20.9 -3.14,33.32 -1.37,6.69 -6.01,15.02 -11.34,18.3l-1.09,1.91c3.01,-0.14 10.38,-7.38 12.97,-16.39 4.37,-15.3 6.15,-22.4 4.1,-39.33 -0.27,-1.64 -0.96,-7.24 -3.55,-13.25 -3.82,-9.15 -9.29,-17.89 -9.97,-19.67 -1.23,-2.87 -2.87,-15.3 -3.14,-23.76z"/>
|
||||
<path android:fillColor="#FF000000" android:pathData="m97.45,61.39c-0.41,7.3 -0.51,9.99 0.85,15.31 1.5,5.87 9.15,14.34 12.29,24.04 6.01,18.57 4.51,42.88 0.14,61.87 -1.64,6.69 -9.42,16.39 -17.21,19.53l5.74,1.37c3.14,-0.14 11.2,-7.65 14.34,-16.25 5.05,-13.52 6.01,-29.64 3.96,-46.57 -0.14,-1.64 -2.87,-16.25 -5.46,-22.4 -3.69,-9.15 -10.24,-17.34 -10.93,-19.12 -1.23,-3.01 -3.93,-9.24 -3.72,-17.77z"/>
|
||||
<path android:fillColor="#FF000000" android:pathData="M93.11,56.25h0.55v126.02h-0.55z"/>
|
||||
</vector>
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<android.support.design.widget.CoordinatorLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main_content"
|
||||
|
@ -9,7 +10,7 @@
|
|||
tools:context="com.github.dfa.diaspora_android.activity.AboutActivity">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:id="@+id/about__appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
android:layout_height="16dp" />
|
||||
|
||||
<com.github.dfa.diaspora_android.ui.HtmlTextView
|
||||
android:id="@+id/fragment_about__about_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/fragment_about__about_content"
|
||||
|
|
35
app/src/main/res/layout/color_picker__dialog.xml
Normal file
35
app/src/main/res/layout/color_picker__dialog.xml
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<FrameLayout
|
||||
android:id="@+id/color_picker_dialog__title_background"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/color_picker_dialog__title"
|
||||
android:layout_margin="20dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Large.Inverse"
|
||||
/>
|
||||
</FrameLayout>
|
||||
<uz.shift.colorpicker.LineColorPicker
|
||||
android:id="@+id/color_picker_dialog__base_picker"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_margin="10dp"
|
||||
app:orientation="horizontal"/>
|
||||
<uz.shift.colorpicker.LineColorPicker
|
||||
android:id="@+id/color_picker_dialog__shade_picker"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
app:orientation="horizontal"/>
|
||||
|
||||
</LinearLayout>
|
|
@ -8,9 +8,9 @@
|
|||
tools:context=".activity.MainActivity">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/main__appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/nav_drawer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="110dp"
|
||||
android:gravity="bottom"
|
||||
|
|
28
app/src/main/res/layout/settings__activity.xml
Normal file
28
app/src/main/res/layout/settings__activity.xml
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical">
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/settings__appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/settings__toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:layout_scrollFlags="scroll|enterAlways|snap"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay"/>
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/settings__fragment_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
|
||||
|
||||
</LinearLayout>
|
|
@ -4,6 +4,9 @@ https://github.com/guardianproject/NetCipher
|
|||
NEWENTRY ButterKnife
|
||||
https://jakewharton.github.io/butterknife
|
||||
|
||||
NEWENTRY ShiftColorPicker
|
||||
https://github.com/DASAR/ShiftColorPicker
|
||||
|
||||
NEWENTRY Android Support Library
|
||||
https://developer.android.com/topic/libraries/support-library/index.html
|
||||
|
||||
|
|
|
@ -14,6 +14,13 @@
|
|||
<string name="pref_title__sub_nav_slider">Navigations Slider</string>
|
||||
<string name="pref_desc__sub_nav_slider">Konfiguration der Sichtbarkeit von Einträgen im Navigation-Slider</string>
|
||||
<string name="pref_cat__visibility_nav_items">Sichtbarkeit der Einträge</string>
|
||||
<!-- Themes -->
|
||||
<string name="pref_title__themes">Farbschema</string>
|
||||
<string name="pref_desc__themes">Einstellungen des Farbdesigns</string>
|
||||
<string name="pref_title__primary_color">Primärfarbe</string>
|
||||
<string name="pref_desc__primary_color">Färbung der Werkzeugleisten</string>
|
||||
<string name="pref_title__accent_color">Akzentfarbe</string>
|
||||
<string name="pref_desc__accent_color">Färbung der Details</string>
|
||||
<!-- Font size -->
|
||||
<string name="pref_title__font_size">Schriftgröße</string>
|
||||
<!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash -->
|
||||
|
@ -23,9 +30,9 @@
|
|||
<!-- Proxy -->
|
||||
<string name="pref_title__sub_proxy">Proxy</string>
|
||||
<string name="pref_title__proxy_enabled">Aktiviere Netzwerkproxy</string>
|
||||
<string name="pref_desc__proxy_enabled">Nutze einen Proxyserver, um Firewalls zu umgehen</string>
|
||||
<string name="pref_title__proxy_host">Host</string>
|
||||
<string name="pref_title__proxy_port">Port</string>
|
||||
<string name="pref_desc__http_proxy_enabled">Nutze einen Proxyserver, um Firewalls zu umgehen</string>
|
||||
<string name="pref_title__http_proxy_host">Host</string>
|
||||
<string name="pref_title__http_proxy_port">Port</string>
|
||||
<!-- Chrome custom tabs -->
|
||||
<string name="pref_title__chrome_custom_tabs_enabled">Chrome Custom Tabs</string>
|
||||
<string name="pref_desc__chrome_custom_tabs_enabled">Externe Links mit Chrome Custom Tabs öffnen. Chromium oder Google Chrome muss für dieses Feature installiert sein.\nWICHTIGER HINWEIS: Chrome Custom Tabs verwenden die konfigurierten Proxy-Server nicht!</string>
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
<string name="pref_desc__load_images">Desactivar la carga de de imágenes a datos móviles seguros</string>
|
||||
<!-- Proxy -->
|
||||
<string name="pref_title__proxy_enabled">Activar Proxy</string>
|
||||
<string name="pref_desc__proxy_enabled">El tráfico proxificado de Diaspora para evitar firewalls.\nPuede necesitar reiniciarse</string>
|
||||
<string name="pref_title__proxy_host">Anfitrión</string>
|
||||
<string name="pref_title__proxy_port">Puerto</string>
|
||||
<string name="pref_desc__http_proxy_enabled">El tráfico proxificado de Diaspora para evitar firewalls.\nPuede necesitar reiniciarse</string>
|
||||
<string name="pref_title__http_proxy_host">Anfitrión</string>
|
||||
<string name="pref_title__http_proxy_port">Puerto</string>
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<string name="pref_title__personal_settings">Configuración personal</string>
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
<!-- Proxy -->
|
||||
<string name="pref_title__sub_proxy">Proxy</string>
|
||||
<string name="pref_title__proxy_enabled">Activer Proxy</string>
|
||||
<string name="pref_desc__proxy_enabled">Serveur Proxy.\n(Nécessite un redémarrage)</string>
|
||||
<string name="pref_title__proxy_host">Hôte</string>
|
||||
<string name="pref_title__proxy_port">Port</string>
|
||||
<string name="pref_desc__http_proxy_enabled">Serveur Proxy.\n(Nécessite un redémarrage)</string>
|
||||
<string name="pref_title__http_proxy_host">Hôte</string>
|
||||
<string name="pref_title__http_proxy_port">Port</string>
|
||||
<!-- Chrome custom tabs -->
|
||||
<string name="pref_title__chrome_custom_tabs_enabled">Onglets personnalisés de Chrome</string>
|
||||
<!-- Diaspora Settings -->
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
<!-- Proxy -->
|
||||
<string name="pref_title__sub_proxy">Proxy</string>
|
||||
<string name="pref_title__proxy_enabled">Attiva proxy</string>
|
||||
<string name="pref_desc__proxy_enabled">Traffico del proxy di Diaspora per bypassare i firewall.\nPuò essere necessario il riavvio dell\'app</string>
|
||||
<string name="pref_title__proxy_host">Host</string>
|
||||
<string name="pref_title__proxy_port">Porta</string>
|
||||
<string name="pref_desc__http_proxy_enabled">Traffico del proxy di Diaspora per bypassare i firewall.\nPuò essere necessario il riavvio dell\'app</string>
|
||||
<string name="pref_title__http_proxy_host">Host</string>
|
||||
<string name="pref_title__http_proxy_port">Porta</string>
|
||||
<!-- Chrome custom tabs -->
|
||||
<string name="pref_title__chrome_custom_tabs_enabled">Schede personalizzate di Chrome</string>
|
||||
<!-- Diaspora Settings -->
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
<!-- Proxy -->
|
||||
<string name="pref_title__sub_proxy">プロキシ</string>
|
||||
<string name="pref_title__proxy_enabled">プロキシを有効にする</string>
|
||||
<string name="pref_desc__proxy_enabled">Diaspora の通信をプロキシして、ファイアウォールに回避します。\n再起動が必要になることがあります</string>
|
||||
<string name="pref_title__proxy_host">ホスト</string>
|
||||
<string name="pref_title__proxy_port">ポート</string>
|
||||
<string name="pref_desc__http_proxy_enabled">Diaspora の通信をプロキシして、ファイアウォールに回避します。\n再起動が必要になることがあります</string>
|
||||
<string name="pref_title__http_proxy_host">ホスト</string>
|
||||
<string name="pref_title__http_proxy_port">ポート</string>
|
||||
<!-- Chrome custom tabs -->
|
||||
<string name="pref_title__chrome_custom_tabs_enabled">Chrome カスタムタブ</string>
|
||||
<!-- Diaspora Settings -->
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
<string name="pref_desc__load_images">മൊബൈൽ ഡാറ്റ ഉപഭോഗം കുറയ്ക്കാനായി ചിത്രങ്ങൾ ലോഡ് ചെയ്യാതിരിക്കുക</string>
|
||||
<!-- Proxy -->
|
||||
<string name="pref_title__proxy_enabled">പ്രോക്സി അനുവദിക്കൂ</string>
|
||||
<string name="pref_desc__proxy_enabled">ഫയർവാളുകളെ മറികടക്കാൻ ഡയസ്പോറ ട്രാഫിക് പ്രോക്സി ചെയ്യൂ.\nപുനരാരംഭിക്കേണ്ടി വന്നേക്കാം</string>
|
||||
<string name="pref_title__proxy_host">ആഥിതേയൻ</string>
|
||||
<string name="pref_title__proxy_port">പോർട്ട്</string>
|
||||
<string name="pref_desc__http_proxy_enabled">ഫയർവാളുകളെ മറികടക്കാൻ ഡയസ്പോറ ട്രാഫിക് പ്രോക്സി ചെയ്യൂ.\nപുനരാരംഭിക്കേണ്ടി വന്നേക്കാം</string>
|
||||
<string name="pref_title__http_proxy_host">ആഥിതേയൻ</string>
|
||||
<string name="pref_title__http_proxy_port">പോർട്ട്</string>
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<string name="pref_title__personal_settings">സ്വകാര്യ സജ്ജീകരണങ്ങൾ</string>
|
||||
|
|
|
@ -21,9 +21,9 @@
|
|||
<string name="pref_desc__load_images">Afbeelding laden uitschakelen om mobiele data te besparen</string>
|
||||
<!-- Proxy -->
|
||||
<string name="pref_title__proxy_enabled">Proxy inschakelen</string>
|
||||
<string name="pref_desc__proxy_enabled">Gebruik een Proxy voor Diaspora om de firewalls te omzeilen.\nRestart nodig</string>
|
||||
<string name="pref_title__proxy_host">Host</string>
|
||||
<string name="pref_title__proxy_port">Poort</string>
|
||||
<string name="pref_desc__http_proxy_enabled">Gebruik een Proxy voor Diaspora om de firewalls te omzeilen.\nRestart nodig</string>
|
||||
<string name="pref_title__http_proxy_host">Host</string>
|
||||
<string name="pref_title__http_proxy_port">Poort</string>
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<string name="pref_title__personal_settings">Persoonlijke instellingen</string>
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
<string name="pref_desc__load_images">Desabilitar o carregamento de imagens para economizar seus créditos</string>
|
||||
<!-- Proxy -->
|
||||
<string name="pref_title__proxy_enabled">Habilitar o Proxy</string>
|
||||
<string name="pref_desc__proxy_enabled">Usar proxy para o tráfego da diáspora para contornar firewalls.\nPode requerer reinicialização</string>
|
||||
<string name="pref_title__proxy_host">Servidor</string>
|
||||
<string name="pref_title__proxy_port">Porta</string>
|
||||
<string name="pref_desc__http_proxy_enabled">Usar proxy para o tráfego da diáspora para contornar firewalls.\nPode requerer reinicialização</string>
|
||||
<string name="pref_title__http_proxy_host">Servidor</string>
|
||||
<string name="pref_title__http_proxy_port">Porta</string>
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<string name="pref_title__personal_settings">Configurações pessoais</string>
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
<string name="pref_desc__load_images">Отключить загрузку изображений для экономии траффика</string>
|
||||
<!-- Proxy -->
|
||||
<string name="pref_title__proxy_enabled">Использовать прокси</string>
|
||||
<string name="pref_desc__proxy_enabled">Перенаправить трафик Диаспоры в обход брандмауэров.\nМожет потребовать перезапуска</string>
|
||||
<string name="pref_title__proxy_host">Хост</string>
|
||||
<string name="pref_title__proxy_port">Порт</string>
|
||||
<string name="pref_desc__http_proxy_enabled">Перенаправить трафик Диаспоры в обход брандмауэров.\nМожет потребовать перезапуска</string>
|
||||
<string name="pref_title__http_proxy_host">Хост</string>
|
||||
<string name="pref_title__http_proxy_port">Порт</string>
|
||||
<!-- Chrome custom tabs -->
|
||||
<!-- Diaspora Settings -->
|
||||
<string name="pref_title__personal_settings">Личные настройки</string>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<resources>>
|
||||
|
||||
<style name="AppTheme.NoActionBar">
|
||||
<style name="DiasporaLight.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">@color/primary</color>
|
||||
<color name="colorPrimaryDark">@color/primary_dark</color>
|
||||
<color name="colorAccent">@color/accent</color>
|
||||
<color name="colorPrimary">@color/md_blue_650</color>
|
||||
<color name="colorPrimaryDark">@color/md_blue_750</color>
|
||||
<color name="colorAccent">@color/md_deep_orange_650</color>
|
||||
|
||||
<!-- Colors from Palette -->
|
||||
<color name="primary">#207be6</color>
|
||||
<color name="primary_dark">#195ed2</color>
|
||||
<color name="primary">@color/md_blue_650</color>
|
||||
<color name="primary_dark">@color/md_blue_750</color>
|
||||
<color name="accent">@color/md_deep_orange_650</color>
|
||||
<color name="primary_light">#BBDEFB</color>
|
||||
<color name="accent">#FF5300</color>
|
||||
<color name="primary_text">#212121</color>
|
||||
<color name="secondary_text">#727272</color>
|
||||
<color name="icons">#FFFFFF</color>
|
||||
|
@ -17,4 +17,331 @@
|
|||
|
||||
<color name="white">#ffffff</color>
|
||||
<color name="black">#000000</color>
|
||||
</resources>
|
||||
|
||||
<!-- Taken from org.horaapps.leafpic -->
|
||||
<!--Accent Color Collection-->
|
||||
<color name="accent_red">#f44336</color>
|
||||
<color name="accent_pink">#e91e63</color>
|
||||
<color name="accent_purple">#9c27b0</color>
|
||||
<color name="accent_deep_purple">#673ab7</color>
|
||||
<color name="accent_indago">#3f51b5</color>
|
||||
<color name="accent_blue">#2196f3</color>
|
||||
<color name="accent_cyan">#00bcd4</color>
|
||||
<color name="accent_teal">#009688</color>
|
||||
<color name="accent_green">#4caf50</color>
|
||||
<color name="accent_yellow">#ffeb3b</color>
|
||||
<color name="accent_amber">#ffc107</color>
|
||||
<color name="accent_orange">#ff9800</color>
|
||||
<color name="accent_brown">#795548</color>
|
||||
<color name="accent_white">#FFFFFF</color>
|
||||
<color name="accent_grey">#9e9e9e</color>
|
||||
<color name="accent_black">#000000</color>
|
||||
|
||||
<!--MATERIAL COLORS-->
|
||||
<color name="md_black_1000">#000000</color>
|
||||
|
||||
<color name="md_light_primary_icon">#8A000000</color>
|
||||
<color name="md_light_primary_text">#DE000000</color>
|
||||
<color name="md_light_secondary">#8A000000</color>
|
||||
<color name="md_light_statusbar">@color/md_grey_300</color>
|
||||
<color name="md_light_appbar">@color/md_grey_100</color>
|
||||
<color name="md_light_background">@color/md_grey_200</color>
|
||||
<color name="md_light_cards">@color/md_white_1000</color>
|
||||
<color name="md_light_dialogs">@color/md_white_1000</color>
|
||||
<color name="md_light_disabled">#61000000</color>
|
||||
<color name="md_light_dividers">#1F000000</color>
|
||||
|
||||
<color name="md_dark_appbar">@color/md_grey_900</color>
|
||||
<color name="md_dark_background">@color/md_grey_850</color>
|
||||
<color name="md_dark_cards">@color/md_grey_800</color>
|
||||
<color name="md_dark_dialogs">@color/md_grey_800</color>
|
||||
<color name="md_dark_disabled">#4DFFFFFF</color>
|
||||
<color name="md_dark_dividers">#1FFFFFFF</color>
|
||||
<color name="md_dark_primary_icon">#B3FFFFFF</color>
|
||||
<color name="md_dark_primary_text">#FFFFFFFF</color>
|
||||
<color name="md_dark_secondary">#B3FFFFFF</color>
|
||||
<color name="md_dark_statusbar">@color/md_black_1000</color>
|
||||
|
||||
<!--ALL COLOURS-->
|
||||
<color name="md_amber_100">#FFECB3</color>
|
||||
<color name="md_amber_200">#FFE082</color>
|
||||
<color name="md_amber_300">#FFD54F</color>
|
||||
<color name="md_amber_400">#FFCA28</color>
|
||||
<color name="md_amber_50">#FFF8E1</color>
|
||||
<color name="md_amber_500">#FFC107</color>
|
||||
<color name="md_amber_600">#FFB300</color>
|
||||
<color name="md_amber_700">#FFA000</color>
|
||||
<color name="md_amber_800">#FF8F00</color>
|
||||
<color name="md_amber_900">#FF6F00</color>
|
||||
<color name="md_amber_A100">#FFE57F</color>
|
||||
<color name="md_amber_A200">#FFD740</color>
|
||||
<color name="md_amber_A400">#FFC400</color>
|
||||
<color name="md_amber_A700">#FFAB00</color>
|
||||
|
||||
<color name="md_blue_100">#BBDEFB</color>
|
||||
<color name="md_blue_200">#90CAF9</color>
|
||||
<color name="md_blue_300">#64B5F6</color>
|
||||
<color name="md_blue_400">#42A5F5</color>
|
||||
<color name="md_blue_50">#E3F2FD</color>
|
||||
<color name="md_blue_500">#2196F3</color>
|
||||
<color name="md_blue_600">#1E88E5</color>
|
||||
<color name="md_blue_650">#207be6</color>
|
||||
<color name="md_blue_700">#1976D2</color>
|
||||
<color name="md_blue_750">#195ed2</color>
|
||||
<color name="md_blue_800">#1565C0</color>
|
||||
<color name="md_blue_900">#0D47A1</color>
|
||||
<color name="md_blue_A100">#82B1FF</color>
|
||||
<color name="md_blue_A200">#448AFF</color>
|
||||
<color name="md_blue_A400">#2979FF</color>
|
||||
<color name="md_blue_A700">#2962FF</color>
|
||||
|
||||
<color name="md_blue_grey_100">#CFD8DC</color>
|
||||
<color name="md_blue_grey_200">#B0BEC5</color>
|
||||
<color name="md_blue_grey_300">#90A4AE</color>
|
||||
<color name="md_blue_grey_400">#78909C</color>
|
||||
<color name="md_blue_grey_50">#ECEFF1</color>
|
||||
<color name="md_blue_grey_500">#607D8B</color>
|
||||
<color name="md_blue_grey_600">#546E7A</color>
|
||||
<color name="md_blue_grey_700">#455A64</color>
|
||||
<color name="md_blue_grey_800">#37474F</color>
|
||||
<color name="md_blue_grey_900">#263238</color>
|
||||
|
||||
<color name="md_brown_100">#D7CCC8</color>
|
||||
<color name="md_brown_200">#BCAAA4</color>
|
||||
<color name="md_brown_300">#A1887F</color>
|
||||
<color name="md_brown_400">#8D6E63</color>
|
||||
<color name="md_brown_50">#EFEBE9</color>
|
||||
<color name="md_brown_500">#795548</color>
|
||||
<color name="md_brown_600">#6D4C41</color>
|
||||
<color name="md_brown_700">#5D4037</color>
|
||||
<color name="md_brown_800">#4E342E</color>
|
||||
<color name="md_brown_900">#3E2723</color>
|
||||
|
||||
<color name="md_cyan_100">#B2EBF2</color>
|
||||
<color name="md_cyan_200">#80DEEA</color>
|
||||
<color name="md_cyan_300">#4DD0E1</color>
|
||||
<color name="md_cyan_400">#26C6DA</color>
|
||||
<color name="md_cyan_50">#E0F7FA</color>
|
||||
<color name="md_cyan_500">#00BCD4</color>
|
||||
<color name="md_cyan_600">#00ACC1</color>
|
||||
<color name="md_cyan_700">#0097A7</color>
|
||||
<color name="md_cyan_800">#00838F</color>
|
||||
<color name="md_cyan_900">#006064</color>
|
||||
<color name="md_cyan_A100">#84FFFF</color>
|
||||
<color name="md_cyan_A200">#18FFFF</color>
|
||||
<color name="md_cyan_A400">#00E5FF</color>
|
||||
<color name="md_cyan_A700">#00B8D4</color>
|
||||
|
||||
|
||||
|
||||
<color name="md_deep_orange_100">#FFCCBC</color>
|
||||
<color name="md_deep_orange_200">#FFAB91</color>
|
||||
<color name="md_deep_orange_300">#FF8A65</color>
|
||||
<color name="md_deep_orange_400">#FF7043</color>
|
||||
<color name="md_deep_orange_50">#FBE9E7</color>
|
||||
<color name="md_deep_orange_500">#FF5722</color>
|
||||
<color name="md_deep_orange_600">#F4511E</color>
|
||||
<color name="md_deep_orange_650">#FF5300</color>
|
||||
<color name="md_deep_orange_700">#E64A19</color>
|
||||
<color name="md_deep_orange_800">#D84315</color>
|
||||
<color name="md_deep_orange_900">#BF360C</color>
|
||||
<color name="md_deep_orange_A100">#FF9E80</color>
|
||||
<color name="md_deep_orange_A200">#FF6E40</color>
|
||||
<color name="md_deep_orange_A400">#FF3D00</color>
|
||||
<color name="md_deep_orange_A700">#DD2C00</color>
|
||||
|
||||
<color name="md_deep_purple_100">#D1C4E9</color>
|
||||
<color name="md_deep_purple_200">#B39DDB</color>
|
||||
<color name="md_deep_purple_300">#9575CD</color>
|
||||
<color name="md_deep_purple_400">#7E57C2</color>
|
||||
<color name="md_deep_purple_50">#EDE7F6</color>
|
||||
<color name="md_deep_purple_500">#673AB7</color>
|
||||
<color name="md_deep_purple_600">#5E35B1</color>
|
||||
<color name="md_deep_purple_700">#512DA8</color>
|
||||
<color name="md_deep_purple_800">#4527A0</color>
|
||||
<color name="md_deep_purple_900">#311B92</color>
|
||||
<color name="md_deep_purple_A100">#B388FF</color>
|
||||
<color name="md_deep_purple_A200">#7C4DFF</color>
|
||||
<color name="md_deep_purple_A400">#651FFF</color>
|
||||
<color name="md_deep_purple_A700">#6200EA</color>
|
||||
|
||||
<color name="md_green_100">#C8E6C9</color>
|
||||
<color name="md_green_200">#A5D6A7</color>
|
||||
<color name="md_green_300">#81C784</color>
|
||||
<color name="md_green_400">#66BB6A</color>
|
||||
<color name="md_green_50">#E8F5E9</color>
|
||||
<color name="md_green_500">#4CAF50</color>
|
||||
<color name="md_green_600">#43A047</color>
|
||||
<color name="md_green_700">#388E3C</color>
|
||||
<color name="md_green_800">#2E7D32</color>
|
||||
<color name="md_green_900">#1B5E20</color>
|
||||
<color name="md_green_A100">#B9F6CA</color>
|
||||
<color name="md_green_A200">#69F0AE</color>
|
||||
<color name="md_green_A400">#00E676</color>
|
||||
<color name="md_green_A700">#00C853</color>
|
||||
|
||||
<color name="md_grey_100">#F5F5F5</color>
|
||||
<color name="md_grey_200">#EEEEEE</color>
|
||||
<color name="md_grey_300">#E0E0E0</color>
|
||||
<color name="md_grey_400">#BDBDBD</color>
|
||||
<color name="md_grey_50">#FAFAFA</color>
|
||||
<color name="md_grey_500">#9E9E9E</color>
|
||||
<color name="md_grey_600">#757575</color>
|
||||
<color name="md_grey_700">#616161</color>
|
||||
<color name="md_grey_800">#424242</color>
|
||||
<color name="md_grey_850">#303030</color>
|
||||
<color name="md_grey_900">#212121</color>
|
||||
|
||||
<color name="md_indigo_100">#C5CAE9</color>
|
||||
<color name="md_indigo_200">#9FA8DA</color>
|
||||
<color name="md_indigo_300">#7986CB</color>
|
||||
<color name="md_indigo_400">#5C6BC0</color>
|
||||
<color name="md_indigo_50">#E8EAF6</color>
|
||||
<color name="md_indigo_500">#3F51B5</color>
|
||||
<color name="md_indigo_600">#3949AB</color>
|
||||
<color name="md_indigo_700">#303F9F</color>
|
||||
<color name="md_indigo_800">#283593</color>
|
||||
<color name="md_indigo_900">#1A237E</color>
|
||||
<color name="md_indigo_A100">#8C9EFF</color>
|
||||
<color name="md_indigo_A200">#536DFE</color>
|
||||
<color name="md_indigo_A400">#3D5AFE</color>
|
||||
<color name="md_indigo_A700">#304FFE</color>
|
||||
|
||||
<color name="md_light_blue_100">#B3E5FC</color>
|
||||
<color name="md_light_blue_200">#81D4FA</color>
|
||||
<color name="md_light_blue_300">#4FC3F7</color>
|
||||
<color name="md_light_blue_400">#29B6F6</color>
|
||||
<color name="md_light_blue_50">#E1F5FE</color>
|
||||
<color name="md_light_blue_500">#03A9F4</color>
|
||||
<color name="md_light_blue_600">#039BE5</color>
|
||||
<color name="md_light_blue_700">#0288D1</color>
|
||||
<color name="md_light_blue_800">#0277BD</color>
|
||||
<color name="md_light_blue_900">#01579B</color>
|
||||
<color name="md_light_blue_A100">#80D8FF</color>
|
||||
<color name="md_light_blue_A200">#40C4FF</color>
|
||||
<color name="md_light_blue_A400">#00B0FF</color>
|
||||
<color name="md_light_blue_A700">#0091EA</color>
|
||||
|
||||
<color name="md_light_green_100">#DCEDC8</color>
|
||||
<color name="md_light_green_200">#C5E1A5</color>
|
||||
<color name="md_light_green_300">#AED581</color>
|
||||
<color name="md_light_green_400">#9CCC65</color>
|
||||
<color name="md_light_green_50">#F1F8E9</color>
|
||||
<color name="md_light_green_500">#8BC34A</color>
|
||||
<color name="md_light_green_600">#7CB342</color>
|
||||
<color name="md_light_green_700">#689F38</color>
|
||||
<color name="md_light_green_800">#558B2F</color>
|
||||
<color name="md_light_green_900">#33691E</color>
|
||||
<color name="md_light_green_A100">#CCFF90</color>
|
||||
<color name="md_light_green_A200">#B2FF59</color>
|
||||
<color name="md_light_green_A400">#76FF03</color>
|
||||
<color name="md_light_green_A700">#64DD17</color>
|
||||
|
||||
<color name="md_lime_100">#F0F4C3</color>
|
||||
<color name="md_lime_200">#E6EE9C</color>
|
||||
<color name="md_lime_300">#DCE775</color>
|
||||
<color name="md_lime_400">#D4E157</color>
|
||||
<color name="md_lime_50">#F9FBE7</color>
|
||||
<color name="md_lime_500">#CDDC39</color>
|
||||
<color name="md_lime_600">#C0CA33</color>
|
||||
<color name="md_lime_700">#AFB42B</color>
|
||||
<color name="md_lime_800">#9E9D24</color>
|
||||
<color name="md_lime_900">#827717</color>
|
||||
<color name="md_lime_A100">#F4FF81</color>
|
||||
<color name="md_lime_A200">#EEFF41</color>
|
||||
<color name="md_lime_A400">#C6FF00</color>
|
||||
<color name="md_lime_A700">#AEEA00</color>
|
||||
|
||||
<color name="md_orange_100">#FFE0B2</color>
|
||||
<color name="md_orange_200">#FFCC80</color>
|
||||
<color name="md_orange_300">#FFB74D</color>
|
||||
<color name="md_orange_400">#FFA726</color>
|
||||
<color name="md_orange_50">#FFF3E0</color>
|
||||
<color name="md_orange_500">#FF9800</color>
|
||||
<color name="md_orange_600">#FB8C00</color>
|
||||
<color name="md_orange_700">#F57C00</color>
|
||||
<color name="md_orange_800">#EF6C00</color>
|
||||
<color name="md_orange_900">#E65100</color>
|
||||
<color name="md_orange_A100">#FFD180</color>
|
||||
<color name="md_orange_A200">#FFAB40</color>
|
||||
<color name="md_orange_A400">#FF9100</color>
|
||||
<color name="md_orange_A700">#FF6D00</color>
|
||||
|
||||
<color name="md_pink_100">#F8BBD0</color>
|
||||
<color name="md_pink_200">#F48FB1</color>
|
||||
<color name="md_pink_300">#F06292</color>
|
||||
<color name="md_pink_400">#EC407A</color>
|
||||
<color name="md_pink_50">#FCE4EC</color>
|
||||
<color name="md_pink_500">#E91E63</color>
|
||||
<color name="md_pink_600">#D81B60</color>
|
||||
<color name="md_pink_700">#C2185B</color>
|
||||
<color name="md_pink_800">#AD1457</color>
|
||||
<color name="md_pink_900">#880E4F</color>
|
||||
<color name="md_pink_A100">#FF80AB</color>
|
||||
<color name="md_pink_A200">#FF4081</color>
|
||||
<color name="md_pink_A400">#F50057</color>
|
||||
<color name="md_pink_A700">#C51162</color>
|
||||
|
||||
<color name="md_purple_100">#E1BEE7</color>
|
||||
<color name="md_purple_200">#CE93D8</color>
|
||||
<color name="md_purple_300">#BA68C8</color>
|
||||
<color name="md_purple_400">#AB47BC</color>
|
||||
<color name="md_purple_50">#F3E5F5</color>
|
||||
<color name="md_purple_500">#9C27B0</color>
|
||||
<color name="md_purple_600">#8E24AA</color>
|
||||
<color name="md_purple_700">#7B1FA2</color>
|
||||
<color name="md_purple_800">#6A1B9A</color>
|
||||
<color name="md_purple_900">#4A148C</color>
|
||||
<color name="md_purple_A100">#EA80FC</color>
|
||||
<color name="md_purple_A200">#E040FB</color>
|
||||
<color name="md_purple_A400">#D500F9</color>
|
||||
<color name="md_purple_A700">#AA00FF</color>
|
||||
|
||||
<color name="md_red_100">#FFCDD2</color>
|
||||
<color name="md_red_200">#EF9A9A</color>
|
||||
<color name="md_red_300">#E57373</color>
|
||||
<color name="md_red_400">#EF5350</color>
|
||||
<color name="md_red_50">#FFEBEE</color>
|
||||
<color name="md_red_500">#F44336</color>
|
||||
<color name="md_red_600">#E53935</color>
|
||||
<color name="md_red_700">#D32F2F</color>
|
||||
<color name="md_red_800">#C62828</color>
|
||||
<color name="md_red_900">#B71C1C</color>
|
||||
<color name="md_red_A100">#FF8A80</color>
|
||||
<color name="md_red_A200">#FF5252</color>
|
||||
<color name="md_red_A400">#FF1744</color>
|
||||
<color name="md_red_A700">#D50000</color>
|
||||
|
||||
<color name="md_teal_100">#B2DFDB</color>
|
||||
<color name="md_teal_200">#80CBC4</color>
|
||||
<color name="md_teal_300">#4DB6AC</color>
|
||||
<color name="md_teal_400">#26A69A</color>
|
||||
<color name="md_teal_50">#E0F2F1</color>
|
||||
<color name="md_teal_500">#009688</color>
|
||||
<color name="md_teal_600">#00897B</color>
|
||||
<color name="md_teal_700">#00796B</color>
|
||||
<color name="md_teal_800">#00695C</color>
|
||||
<color name="md_teal_900">#004D40</color>
|
||||
<color name="md_teal_A100">#A7FFEB</color>
|
||||
<color name="md_teal_A200">#64FFDA</color>
|
||||
<color name="md_teal_A400">#1DE9B6</color>
|
||||
<color name="md_teal_A700">#00BFA5</color>
|
||||
|
||||
<color name="md_white_1000">#FFFFFF</color>
|
||||
<color name="md_yellow_100">#FFF9C4</color>
|
||||
<color name="md_yellow_200">#FFF59D</color>
|
||||
<color name="md_yellow_300">#FFF176</color>
|
||||
<color name="md_yellow_400">#FFEE58</color>
|
||||
<color name="md_yellow_50">#FFFDE7</color>
|
||||
<color name="md_yellow_500">#FFEB3B</color>
|
||||
<color name="md_yellow_600">#FDD835</color>
|
||||
<color name="md_yellow_700">#FBC02D</color>
|
||||
<color name="md_yellow_800">#F9A825</color>
|
||||
<color name="md_yellow_900">#F57F17</color>
|
||||
<color name="md_yellow_A100">#FFFF8D</color>
|
||||
<color name="md_yellow_A200">#FFFF00</color>
|
||||
<color name="md_yellow_A400">#FFEA00</color>
|
||||
<color name="md_yellow_A700">#FFD600</color>
|
||||
|
||||
<color name="transparent_black">#c4000000</color>
|
||||
</resources>
|
|
@ -15,11 +15,20 @@
|
|||
<string name="pref_key__load_images" translatable="false">pref_key_load_images</string>
|
||||
<string name="pref_key__clear_cache" translatable="false">pref_key_clear_cache</string>
|
||||
<string name="pref_key__chrome_custom_tabs_enabled" translatable="false">pref_key__chrome_custom_tabs_enabled</string>
|
||||
<string name="pref_key__http_proxy_load_tor_preset">pref_key__http_proxy_load_tor_preset</string>
|
||||
|
||||
<!-- Themes -->
|
||||
<string name="pref_key__primary_color__preference_click" translatable="false">pref_key_primary_color</string>
|
||||
<string name="pref_key__primary_color_base" translatable="false">pref_key_primary_color_base</string>
|
||||
<string name="pref_key__primary_color_shade" translatable="false">pref_key_primary_color_shade</string>
|
||||
<string name="pref_key__accent_color__preference_click" translatable="false">pref_key_accent_color</string>
|
||||
<string name="pref_key__accent_color_base" translatable="false">pref_key_accent_color_base</string>
|
||||
<string name="pref_key__accent_color_shade" translatable="false">pref_key_accent_color_shade</string>
|
||||
|
||||
<string name="pref_key__append_shared_via_app" translatable="false">pref_key_append_shared_via_app</string>
|
||||
<string name="pref_key__proxy_enabled" translatable="false">pref_key_proxy_enabled</string>
|
||||
<string name="pref_key__proxy_host" translatable="false">pref_key_proxy_host</string>
|
||||
<string name="pref_key__proxy_port" translatable="false">pref_key_proxy_port</string>
|
||||
<string name="pref_key__http_proxy_enabled" translatable="false">pref_key_proxy_enabled</string>
|
||||
<string name="pref_key__http_proxy_host" translatable="false">pref_key_proxy_host</string>
|
||||
<string name="pref_key__http_proxy_port" translatable="false">pref_key_proxy_port</string>
|
||||
<string name="pref_key__proxy_was_enabled" translatable="false">wasProxyEnabled</string>
|
||||
|
||||
<!-- Navigiation Slider -->
|
||||
|
@ -61,6 +70,13 @@
|
|||
<string name="pref_desc__sub_nav_slider">Control visibility of entries in the navigation drawer</string>
|
||||
<string name="pref_cat__visibility_nav_items">Item visibility</string>
|
||||
|
||||
<!-- Themes -->
|
||||
<string name="pref_title__themes">Theme and Colors</string>
|
||||
<string name="pref_desc__themes">Control, which colors are used throughout the app</string>
|
||||
<string name="pref_title__primary_color">Primary Color</string>
|
||||
<string name="pref_desc__primary_color">Color of the toolbars</string>
|
||||
<string name="pref_title__accent_color">Accent Color</string>
|
||||
<string name="pref_desc__accent_color">Color of the progressbar</string>
|
||||
|
||||
<!-- Font size -->
|
||||
<string name="pref_title__font_size">Font size</string>
|
||||
|
@ -81,12 +97,16 @@
|
|||
<string name="pref_desc__load_images">Disable image loading to safe mobile data</string>
|
||||
|
||||
<!-- Proxy -->
|
||||
<string name="pref_title__http_proxy_load_tor_preset">Load Tor Preset</string>
|
||||
<string name="pref_desc__http_proxy_load_tor_preset">Load proxy settings for Tor (Orbot) HTTP Proxy</string>
|
||||
<string name="pref_title__sub_proxy">Proxy</string>
|
||||
<string name="pref_desc__sub_proxy" translatable="false">@string/pref_desc__proxy_enabled</string>
|
||||
<string name="pref_desc__sub_proxy" translatable="false">@string/pref_desc__http_proxy_enabled</string>
|
||||
<string name="pref_title__proxy_enabled">Enable Proxy</string>
|
||||
<string name="pref_desc__proxy_enabled">Proxy Diaspora\'s traffic to circumvent firewalls.\nMay require restart</string>
|
||||
<string name="pref_title__proxy_host">Host</string>
|
||||
<string name="pref_title__proxy_port">Port</string>
|
||||
<string name="pref_desc__http_proxy_enabled">Proxy Diaspora\'s traffic to circumvent firewalls.\nMay require restart</string>
|
||||
<string name="pref_title__http_proxy_host">Host</string>
|
||||
<string name="pref_title__http_proxy_port">Port</string>
|
||||
<string name="HTTP" translatable="false">HTTP</string>
|
||||
<string name="SOCKS5" translatable="false">SOCKS5</string>
|
||||
|
||||
|
||||
<!-- Chrome custom tabs -->
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<style name="DiasporaLight" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
|
@ -9,11 +9,14 @@
|
|||
<item name="actionMenuTextColor">@color/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.NoActionBar">
|
||||
<style name="DiasporaLight.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<style name="Settings" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
|
||||
</style>
|
||||
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
||||
|
||||
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
||||
|
|
|
@ -57,6 +57,22 @@
|
|||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
|
||||
<PreferenceScreen
|
||||
android:title="@string/pref_title__themes"
|
||||
android:summary="@string/pref_desc__themes" >
|
||||
|
||||
<Preference
|
||||
android:key="@string/pref_key__primary_color__preference_click"
|
||||
android:summary="@string/pref_desc__primary_color"
|
||||
android:title="@string/pref_title__primary_color" />
|
||||
|
||||
<Preference
|
||||
android:key="@string/pref_key__accent_color__preference_click"
|
||||
android:summary="@string/pref_desc__accent_color"
|
||||
android:title="@string/pref_title__accent_color" />
|
||||
|
||||
</PreferenceScreen>
|
||||
|
||||
<ListPreference
|
||||
android:dialogTitle="@string/pref_title__font_size"
|
||||
android:entries="@array/pref_entries__font_size"
|
||||
|
@ -129,21 +145,34 @@
|
|||
<PreferenceScreen
|
||||
android:summary="@string/pref_desc__sub_proxy"
|
||||
android:title="@string/pref_title__sub_proxy">
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="@string/pref_key__proxy_enabled"
|
||||
android:summary="@string/pref_desc__proxy_enabled"
|
||||
android:title="@string/pref_title__proxy_enabled"/>
|
||||
<EditTextPreference
|
||||
android:dependency="@string/pref_key__proxy_enabled"
|
||||
android:inputType="textNoSuggestions"
|
||||
android:key="@string/pref_key__proxy_host"
|
||||
android:title="@string/pref_title__proxy_host"/>
|
||||
<EditTextPreference
|
||||
android:dependency="@string/pref_key__proxy_enabled"
|
||||
android:inputType="number"
|
||||
android:key="@string/pref_key__proxy_port"
|
||||
android:title="@string/pref_title__proxy_port"/>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/HTTP">
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="@string/pref_key__http_proxy_enabled"
|
||||
android:summary="@string/pref_desc__http_proxy_enabled"
|
||||
android:title="@string/pref_title__proxy_enabled"/>
|
||||
|
||||
<EditTextPreference
|
||||
android:dependency="@string/pref_key__http_proxy_enabled"
|
||||
android:inputType="textNoSuggestions"
|
||||
android:key="@string/pref_key__http_proxy_host"
|
||||
android:title="@string/pref_title__http_proxy_host"/>
|
||||
<EditTextPreference
|
||||
android:dependency="@string/pref_key__http_proxy_enabled"
|
||||
android:inputType="number"
|
||||
android:key="@string/pref_key__http_proxy_port"
|
||||
android:title="@string/pref_title__http_proxy_port"/>
|
||||
|
||||
<Preference
|
||||
android:icon="@drawable/tor_onion"
|
||||
android:dependency="@string/pref_key__http_proxy_enabled"
|
||||
android:key="@string/pref_key__http_proxy_load_tor_preset"
|
||||
android:summary="@string/pref_desc__http_proxy_load_tor_preset"
|
||||
android:title="@string/pref_title__http_proxy_load_tor_preset"/>
|
||||
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
</PreferenceCategory>
|
||||
|
||||
|
@ -164,8 +193,6 @@
|
|||
android:defaultValue="true"
|
||||
android:key="@string/pref_key__logging_spam_enabled"
|
||||
android:title="@string/pref_title__logging_spam_enabled"/>
|
||||
|
||||
|
||||
</PreferenceScreen>
|
||||
|
||||
</PreferenceCategory>
|
||||
|
|
Loading…
Reference in a new issue