mirror of
https://github.com/k0shk0sh/FastHub.git
synced 2026-01-25 14:47:05 +00:00
commit
77bd45076f
@ -22,14 +22,14 @@ android {
|
||||
storePassword((buildProperties.secrets['android_store_password'] | buildProperties.notThere['android_store_password']).string)
|
||||
}
|
||||
}
|
||||
compileSdkVersion 26
|
||||
buildToolsVersion "26.0.0"
|
||||
compileSdkVersion 25
|
||||
buildToolsVersion "26.0.0-rc2"
|
||||
defaultConfig {
|
||||
applicationId "com.fastaccess.github"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 26
|
||||
versionCode 301
|
||||
versionName "3.0.1"
|
||||
versionCode 310
|
||||
versionName "3.1.0"
|
||||
signingConfig signingConfigs.signing
|
||||
buildConfigString "GITHUB_CLIENT_ID", (buildProperties.secrets['github_client_id'] | buildProperties.notThere['github_client_id']).string
|
||||
buildConfigString "GITHUB_SECRET", (buildProperties.secrets['github_secret'] | buildProperties.notThere['github_secret']).string
|
||||
@ -149,8 +149,8 @@ dependencies {
|
||||
implementation "com.github.miguelbcr:RxBillingService:0.0.3"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
|
||||
implementation 'org.jsoup:jsoup:1.10.2'
|
||||
implementation 'com.jakewharton:kotterknife:0.1.0-SNAPSHOT'
|
||||
implementation "com.evernote:android-state:${state_version}"
|
||||
implementation "petrov.kristiyan:colorpicker-library:1.1.4"
|
||||
compileOnly "org.projectlombok:lombok:${lombokVersion}"
|
||||
kapt "io.requery:requery-processor:${requery}"
|
||||
kapt "org.projectlombok:lombok:${lombokVersion}"
|
||||
|
||||
@ -7,4 +7,5 @@
|
||||
<string name="donation_product_3" translatable="false">android.test.refunded</string>
|
||||
<string name="donation_product_4" translatable="false">android.test.item_unavailable</string>
|
||||
<string name="amlod_theme_purchase" translatable="false">android.test.purchased</string>
|
||||
<string name="midnight_blue_theme_purchase" translatable="false">android.test.purchased</string>
|
||||
</resources>
|
||||
@ -215,6 +215,7 @@ import lombok.Setter;
|
||||
return Stream.of(new FragmentPagerAdapterModel("", ThemeFragment.Companion.newInstance(R.style.ThemeLight)),
|
||||
new FragmentPagerAdapterModel("", ThemeFragment.Companion.newInstance(R.style.ThemeDark)),
|
||||
new FragmentPagerAdapterModel("", ThemeFragment.Companion.newInstance(R.style.ThemeAmlod)))
|
||||
// new FragmentPagerAdapterModel("", ThemeFragment.Companion.newInstance(R.style.ThemeMidNighBlue)))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
@ -266,7 +266,7 @@ import static com.annimon.stream.Collectors.toList;
|
||||
.map(TimelineModel::new)
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
return models;
|
||||
return Stream.of(models).sortBy(TimelineModel::getSortedDate).toList();
|
||||
}
|
||||
|
||||
@Override public boolean equals(Object o) {
|
||||
@ -280,7 +280,6 @@ import static com.annimon.stream.Collectors.toList;
|
||||
return comment != null ? (int) comment.getId() : 0;
|
||||
}
|
||||
|
||||
|
||||
@Override public int describeContents() { return 0; }
|
||||
|
||||
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||
|
||||
@ -21,6 +21,7 @@ public class PrefGetter {
|
||||
public static final int LIGHT = 1;
|
||||
public static final int DARK = 2;
|
||||
public static final int AMLOD = 3;
|
||||
public static final int MID_NIGHT_BLUE = 4;
|
||||
|
||||
public static final int RED = 1;
|
||||
public static final int PINK = 2;
|
||||
@ -42,7 +43,8 @@ public class PrefGetter {
|
||||
@IntDef({
|
||||
LIGHT,
|
||||
DARK,
|
||||
AMLOD
|
||||
AMLOD,
|
||||
MID_NIGHT_BLUE
|
||||
})
|
||||
@Retention(RetentionPolicy.SOURCE) @interface ThemeType {}
|
||||
|
||||
@ -86,6 +88,7 @@ public class PrefGetter {
|
||||
private static final String SENT_VIA_BOX = "sent_via_enabled";
|
||||
private static final String PROFILE_BACKGROUND_URL = "profile_background_url";
|
||||
private static final String AMLOD_THEME_ENABLED = "amlod_theme_enabled";
|
||||
private static final String MIDNIGHTBLUE_THEME_ENABLED = "midnightblue_theme_enabled";
|
||||
private static final String PRO_ITEMS = "pro_items";
|
||||
|
||||
public static void setToken(@NonNull String token) {
|
||||
@ -249,6 +252,8 @@ public class PrefGetter {
|
||||
return LIGHT;
|
||||
} else if (appTheme.equalsIgnoreCase(resources.getString(R.string.amlod_theme_mode))) {
|
||||
return AMLOD;
|
||||
} else if (appTheme.equalsIgnoreCase(resources.getString(R.string.mid_night_blue_theme_mode))) {
|
||||
return MID_NIGHT_BLUE;
|
||||
}
|
||||
}
|
||||
return LIGHT;
|
||||
@ -256,6 +261,11 @@ public class PrefGetter {
|
||||
|
||||
@ThemeColor private static int getThemeColor(@NonNull Resources resources) {
|
||||
String appColor = PrefHelper.getString("appColor");
|
||||
return getThemeColor(resources, appColor);
|
||||
}
|
||||
|
||||
// used for color picker to get the index of the color (enum) from the name of the color
|
||||
public static int getThemeColor(@NonNull Resources resources, String appColor) {
|
||||
if (!InputHelper.isEmpty(appColor)) {
|
||||
if (appColor.equalsIgnoreCase(resources.getString(R.string.red_theme_mode)))
|
||||
return RED;
|
||||
@ -329,6 +339,13 @@ public class PrefGetter {
|
||||
public static boolean isAmlodEnabled() {
|
||||
return PrefHelper.getBoolean(AMLOD_THEME_ENABLED);
|
||||
}
|
||||
public static void enableMidNightBlueTheme() {
|
||||
PrefHelper.set(MIDNIGHTBLUE_THEME_ENABLED, true);
|
||||
}
|
||||
|
||||
public static boolean isMidNightBlueThemeEnabled() {
|
||||
return PrefHelper.getBoolean(MIDNIGHTBLUE_THEME_ENABLED);
|
||||
}
|
||||
|
||||
public static void setProItems() {
|
||||
PrefHelper.set(PRO_ITEMS, true);
|
||||
|
||||
@ -88,6 +88,25 @@ object ThemeEngine {
|
||||
PrefGetter.DEEP_ORANGE -> return R.style.ThemeAmlod_DeepOrange
|
||||
else -> return R.style.ThemeAmlod
|
||||
}
|
||||
} else if (themeMode == PrefGetter.MID_NIGHT_BLUE) {
|
||||
when (themeColor) {
|
||||
PrefGetter.RED -> return R.style.ThemeMidNighBlue_Red
|
||||
PrefGetter.PINK -> return R.style.ThemeMidNighBlue_Pink
|
||||
PrefGetter.PURPLE -> return R.style.ThemeMidNighBlue_Purple
|
||||
PrefGetter.DEEP_PURPLE -> return R.style.ThemeMidNighBlue_DeepPurple
|
||||
PrefGetter.INDIGO -> return R.style.ThemeMidNighBlue_Indigo
|
||||
PrefGetter.BLUE -> return R.style.ThemeMidNighBlue
|
||||
PrefGetter.LIGHT_BLUE -> return R.style.ThemeMidNighBlue_LightBlue
|
||||
PrefGetter.CYAN -> return R.style.ThemeMidNighBlue_Cyan
|
||||
PrefGetter.TEAL, PrefGetter.GREEN -> return R.style.ThemeMidNighBlue_Green
|
||||
PrefGetter.LIGHT_GREEN -> return R.style.ThemeMidNighBlue_LightGreen
|
||||
PrefGetter.LIME -> return R.style.ThemeMidNighBlue_Lime
|
||||
PrefGetter.YELLOW -> return R.style.ThemeMidNighBlue_Yellow
|
||||
PrefGetter.AMBER -> return R.style.ThemeMidNighBlue_Amber
|
||||
PrefGetter.ORANGE -> return R.style.ThemeMidNighBlue_Orange
|
||||
PrefGetter.DEEP_ORANGE -> return R.style.ThemeMidNighBlue_DeepOrange
|
||||
else -> return R.style.ThemeMidNighBlue
|
||||
}
|
||||
}
|
||||
return R.style.ThemeLight
|
||||
}
|
||||
|
||||
@ -214,8 +214,8 @@ public class FeedsViewHolder extends BaseViewHolder<Event> {
|
||||
int size = commits != null ? commits.size() : -1;
|
||||
SpannableBuilder spanCommits = SpannableBuilder.builder();
|
||||
if (size > 0) {
|
||||
if (size != 1) spanCommits.append(String.valueOf(eventsModel.getPayload().getSize())).append(" new commits").append(" ");
|
||||
else spanCommits.append("1 new commit").append(" ");
|
||||
if (size != 1) spanCommits.append(String.valueOf(eventsModel.getPayload().getSize())).append(" new commits").append("\n");
|
||||
else spanCommits.append("1 new commit").append("\n");
|
||||
int max = 5;
|
||||
int appended = 0;
|
||||
for (GitCommitModel commit : commits) {
|
||||
@ -224,7 +224,7 @@ public class FeedsViewHolder extends BaseViewHolder<Event> {
|
||||
if (TextUtils.isEmpty(sha)) continue;
|
||||
sha = sha.length() > 7 ? sha.substring(0, 7) : sha;
|
||||
spanCommits.url(sha).append(" ")
|
||||
.append(commit.getMessage() != null ? commit.getMessage().replaceAll("\\r?\\n|\\r"," ") : "")
|
||||
.append(commit.getMessage() != null ? commit.getMessage().replaceAll("\\r?\\n|\\r", " ") : "")
|
||||
.append("\n");
|
||||
appended++;
|
||||
if (appended == max) break;
|
||||
@ -255,7 +255,7 @@ public class FeedsViewHolder extends BaseViewHolder<Event> {
|
||||
.bold("#")
|
||||
.bold(String.valueOf(pullRequest.getNumber()));
|
||||
if (comment.getBody() != null) {
|
||||
MarkDownProvider.stripMdText(description, comment.getBody().replaceAll("\\r?\\n|\\r"," "));
|
||||
MarkDownProvider.stripMdText(description, comment.getBody().replaceAll("\\r?\\n|\\r", " "));
|
||||
description.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
description.setText("");
|
||||
@ -280,7 +280,7 @@ public class FeedsViewHolder extends BaseViewHolder<Event> {
|
||||
.bold(String.valueOf(issue.getNumber()));
|
||||
if ("opened".equals(action) || "closed".equals(action)) {
|
||||
if (issue.getTitle() != null) {
|
||||
MarkDownProvider.stripMdText(description, issue.getTitle().replaceAll("\\r?\\n|\\r"," "));
|
||||
MarkDownProvider.stripMdText(description, issue.getTitle().replaceAll("\\r?\\n|\\r", " "));
|
||||
description.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
description.setText("");
|
||||
@ -325,7 +325,7 @@ public class FeedsViewHolder extends BaseViewHolder<Event> {
|
||||
.bold("#")
|
||||
.bold(String.valueOf(issue.getNumber()));
|
||||
if (issue.getTitle() != null) {
|
||||
MarkDownProvider.stripMdText(description, issue.getTitle().replaceAll("\\r?\\n|\\r"," "));
|
||||
MarkDownProvider.stripMdText(description, issue.getTitle().replaceAll("\\r?\\n|\\r", " "));
|
||||
description.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
description.setText("");
|
||||
@ -348,7 +348,7 @@ public class FeedsViewHolder extends BaseViewHolder<Event> {
|
||||
.bold("#")
|
||||
.bold(String.valueOf(issue.getNumber()));
|
||||
if (comment.getBody() != null) {
|
||||
MarkDownProvider.stripMdText(description, comment.getBody().replaceAll("\\r?\\n|\\r"," "));
|
||||
MarkDownProvider.stripMdText(description, comment.getBody().replaceAll("\\r?\\n|\\r", " "));
|
||||
description.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
description.setText("");
|
||||
@ -420,7 +420,7 @@ public class FeedsViewHolder extends BaseViewHolder<Event> {
|
||||
.append(" ")
|
||||
.append(eventsModel.getRepo().getName());
|
||||
if (payloadModel.getDescription() != null) {
|
||||
MarkDownProvider.stripMdText(description, payloadModel.getDescription().replaceAll("\\r?\\n|\\r"," "));
|
||||
MarkDownProvider.stripMdText(description, payloadModel.getDescription().replaceAll("\\r?\\n|\\r", " "));
|
||||
description.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
description.setText("");
|
||||
@ -445,13 +445,12 @@ public class FeedsViewHolder extends BaseViewHolder<Event> {
|
||||
.append(" ")
|
||||
.bold("commit")
|
||||
.append(" ")
|
||||
.url(commitId != null ? commitId : "")
|
||||
.append(" ")
|
||||
.bold("in")
|
||||
.append(" ")
|
||||
.append(eventsModel.getRepo().getName());
|
||||
.append(eventsModel.getRepo().getName())
|
||||
.url(commitId != null ? "@" + commitId : "");
|
||||
if (comment != null && comment.getBody() != null) {
|
||||
MarkDownProvider.stripMdText(description, comment.getBody().replaceAll("\\r?\\n|\\r"," "));
|
||||
MarkDownProvider.stripMdText(description, comment.getBody().replaceAll("\\r?\\n|\\r", " "));
|
||||
description.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
description.setText("");
|
||||
|
||||
@ -7,7 +7,6 @@ import android.view.ViewGroup;
|
||||
|
||||
import com.fastaccess.R;
|
||||
import com.fastaccess.data.dao.model.Gist;
|
||||
import com.fastaccess.helper.Logger;
|
||||
import com.fastaccess.helper.ParseDateFormat;
|
||||
import com.fastaccess.ui.widgets.AvatarLayout;
|
||||
import com.fastaccess.ui.widgets.FontTextView;
|
||||
@ -15,7 +14,6 @@ import com.fastaccess.ui.widgets.recyclerview.BaseRecyclerAdapter;
|
||||
import com.fastaccess.ui.widgets.recyclerview.BaseViewHolder;
|
||||
|
||||
import butterknife.BindView;
|
||||
|
||||
/**
|
||||
* Created by Kosh on 11 Nov 2016, 2:08 PM
|
||||
*/
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
package com.fastaccess.ui.adapter.viewholder
|
||||
|
||||
import android.view.View
|
||||
import butterknife.bindView
|
||||
import com.fastaccess.R
|
||||
import com.fastaccess.data.dao.TrendingModel
|
||||
import com.fastaccess.provider.colors.ColorsProvider
|
||||
import com.fastaccess.provider.emoji.EmojiParser
|
||||
import com.fastaccess.ui.widgets.FontTextView
|
||||
import com.fastaccess.ui.widgets.bindView
|
||||
import com.fastaccess.ui.widgets.recyclerview.BaseRecyclerAdapter
|
||||
import com.fastaccess.ui.widgets.recyclerview.BaseViewHolder
|
||||
|
||||
|
||||
@ -26,12 +26,14 @@ import android.widget.Toast;
|
||||
import com.evernote.android.state.State;
|
||||
import com.evernote.android.state.StateSaver;
|
||||
import com.fastaccess.App;
|
||||
import com.fastaccess.BuildConfig;
|
||||
import com.fastaccess.R;
|
||||
import com.fastaccess.data.dao.model.Login;
|
||||
import com.fastaccess.helper.AppHelper;
|
||||
import com.fastaccess.helper.BundleConstant;
|
||||
import com.fastaccess.helper.Bundler;
|
||||
import com.fastaccess.helper.InputHelper;
|
||||
import com.fastaccess.helper.Logger;
|
||||
import com.fastaccess.helper.PrefGetter;
|
||||
import com.fastaccess.helper.PrefHelper;
|
||||
import com.fastaccess.helper.ViewHelper;
|
||||
@ -56,6 +58,9 @@ import com.fastaccess.ui.widgets.dialog.ProgressDialogFragment;
|
||||
import com.google.android.gms.ads.AdRequest;
|
||||
import com.google.android.gms.ads.AdView;
|
||||
import com.google.android.gms.ads.MobileAds;
|
||||
import com.miguelbcr.io.rx_billing_service.RxBillingService;
|
||||
import com.miguelbcr.io.rx_billing_service.entities.ProductType;
|
||||
import com.miguelbcr.io.rx_billing_service.entities.Purchase;
|
||||
import com.nostra13.universalimageloader.core.ImageLoader;
|
||||
|
||||
import net.grandcentrix.thirtyinch.TiActivity;
|
||||
@ -65,6 +70,7 @@ import java.util.ArrayList;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import io.reactivex.functions.Action;
|
||||
|
||||
|
||||
/**
|
||||
@ -433,6 +439,33 @@ public abstract class BaseActivity<V extends BaseMvp.FAView, P extends BasePrese
|
||||
}
|
||||
}
|
||||
|
||||
protected void checkPurchases(@Nullable Action action) {
|
||||
getPresenter().manageViewDisposable(RxBillingService.getInstance(this, BuildConfig.DEBUG)
|
||||
.getPurchases(ProductType.IN_APP)
|
||||
.doOnSubscribe(disposable -> showProgress(0))
|
||||
.subscribe((purchases, throwable) -> {
|
||||
hideProgress();
|
||||
if (throwable == null) {
|
||||
Logger.e(purchases);
|
||||
if (purchases != null && !purchases.isEmpty()) {
|
||||
for (Purchase purchase : purchases) {
|
||||
String sku = purchase.sku();
|
||||
if (sku != null) {
|
||||
if (sku.equalsIgnoreCase(getString(R.string.donation_product_1))) {
|
||||
PrefGetter.enableAmlodTheme();
|
||||
} else {
|
||||
PrefGetter.setProItems();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
if (action != null) action.run();
|
||||
}));
|
||||
}
|
||||
|
||||
private void setupTheme() {
|
||||
ThemeEngine.INSTANCE.apply(this);
|
||||
}
|
||||
|
||||
@ -46,6 +46,8 @@ public class FastHubAboutActivity extends MaterialAboutActivity {
|
||||
setTheme(R.style.AppTheme_AboutActivity_Dark);
|
||||
} else if (themeMode == PrefGetter.AMLOD) {
|
||||
setTheme(R.style.AppTheme_AboutActivity_Amlod);
|
||||
} else if (themeMode == PrefGetter.MID_NIGHT_BLUE) {
|
||||
setTheme(R.style.AppTheme_AboutActivity_MidNightBlue);
|
||||
}
|
||||
super.onCreate(savedInstanceState);
|
||||
malRecyclerview = findViewById(R.id.mal_recyclerview);
|
||||
|
||||
@ -25,15 +25,10 @@ import com.fastaccess.helper.AppHelper;
|
||||
import com.fastaccess.helper.BundleConstant;
|
||||
import com.fastaccess.helper.Bundler;
|
||||
import com.fastaccess.helper.InputHelper;
|
||||
import com.fastaccess.helper.Logger;
|
||||
import com.fastaccess.helper.PrefGetter;
|
||||
import com.fastaccess.helper.PrefHelper;
|
||||
import com.fastaccess.ui.base.BaseActivity;
|
||||
import com.fastaccess.ui.modules.main.MainActivity;
|
||||
import com.fastaccess.ui.modules.settings.LanguageBottomSheetDialog;
|
||||
import com.miguelbcr.io.rx_billing_service.RxBillingService;
|
||||
import com.miguelbcr.io.rx_billing_service.entities.ProductType;
|
||||
import com.miguelbcr.io.rx_billing_service.entities.Purchase;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
@ -43,7 +38,6 @@ import butterknife.OnClick;
|
||||
import butterknife.OnEditorAction;
|
||||
import butterknife.Optional;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import io.reactivex.functions.Action;
|
||||
|
||||
/**
|
||||
* Created by Kosh on 08 Feb 2017, 9:10 PM
|
||||
@ -215,35 +209,6 @@ public class LoginActivity extends BaseActivity<LoginMvp.View, LoginPresenter> i
|
||||
progress.setVisibility(View.GONE);
|
||||
login.show();
|
||||
}
|
||||
|
||||
protected void checkPurchases(Action action) {
|
||||
RxBillingService.getInstance(this, BuildConfig.DEBUG)
|
||||
.getPurchases(ProductType.IN_APP)
|
||||
.doOnSubscribe(disposable -> showProgress(0))
|
||||
.subscribe((purchases, throwable) -> {
|
||||
hideProgress();
|
||||
if (throwable == null) {
|
||||
Logger.e(purchases);
|
||||
if (purchases != null && !purchases.isEmpty()) {
|
||||
for (Purchase purchase : purchases) {
|
||||
String sku = purchase.sku();
|
||||
if (sku != null) {
|
||||
Logger.e(sku);
|
||||
if (sku.equalsIgnoreCase(getString(R.string.donation_product_1))) {
|
||||
PrefGetter.enableAmlodTheme();
|
||||
} else {
|
||||
PrefGetter.setProItems();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
action.run();
|
||||
});
|
||||
}
|
||||
|
||||
private void showLanguage() {
|
||||
LanguageBottomSheetDialog languageBottomSheetDialog = new LanguageBottomSheetDialog();
|
||||
languageBottomSheetDialog.onAttach((Context) this);
|
||||
|
||||
@ -10,6 +10,7 @@ import android.support.v4.view.GravityCompat;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import com.evernote.android.state.State;
|
||||
import com.fastaccess.R;
|
||||
import com.fastaccess.data.dao.model.Notification;
|
||||
import com.fastaccess.helper.BundleConstant;
|
||||
@ -25,7 +26,6 @@ import com.fastaccess.ui.modules.settings.SlackBottomSheetDialog;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.OnClick;
|
||||
import com.evernote.android.state.State;
|
||||
import it.sephiroth.android.library.bottomnavigation.BottomNavigation;
|
||||
import shortbread.Shortcut;
|
||||
|
||||
@ -64,6 +64,7 @@ public class MainActivity extends BaseActivity<MainMvp.View, MainPresenter> impl
|
||||
if (getIntent() != null && getIntent().getBooleanExtra(SlackBottomSheetDialog.TAG, false)) {
|
||||
new SlackBottomSheetDialog().show(getSupportFragmentManager(), SlackBottomSheetDialog.TAG);
|
||||
}
|
||||
checkPurchases(null);
|
||||
}
|
||||
selectHome(false);
|
||||
hideShowShadow(navType == MainMvp.FEEDS);
|
||||
|
||||
@ -58,6 +58,8 @@ class DonateActivity : BaseActivity<BaseMvp.FAView, BasePresenter<BaseMvp.FAView
|
||||
showMessage(R.string.success, R.string.success_purchase_message)
|
||||
if (productKey == getString(R.string.donation_product_1) || productKey == getString(R.string.amlod_theme_purchase)) {
|
||||
PrefGetter.enableAmlodTheme()
|
||||
} else if (productKey == getString(R.string.midnight_blue_theme_purchase)) {
|
||||
PrefGetter.enableMidNightBlueTheme()
|
||||
} else {
|
||||
PrefGetter.setProItems()
|
||||
}
|
||||
|
||||
@ -26,9 +26,9 @@ import java.util.*
|
||||
open class ProfileEventsFragment : BaseFragment<ProfileEvents.View, ProfileEventsPresenter>(), ProfileEvents.View {
|
||||
|
||||
|
||||
val recycler: DynamicRecyclerView by lazy { view!!.findViewById<DynamicRecyclerView>(R.id.recycler) }
|
||||
val refresh: SwipeRefreshLayout by lazy { view!!.findViewById<SwipeRefreshLayout>(R.id.refresh) }
|
||||
val stateLayout: StateLayout by lazy { view!!.findViewById<StateLayout>(R.id.stateLayout) }
|
||||
val recycler: DynamicRecyclerView by lazy { view!!.findViewById(R.id.recycler) as DynamicRecyclerView }
|
||||
val refresh: SwipeRefreshLayout by lazy { view!!.findViewById(R.id.refresh) as SwipeRefreshLayout }
|
||||
val stateLayout: StateLayout by lazy { view!!.findViewById(R.id.stateLayout) as StateLayout }
|
||||
|
||||
val adapter by lazy { FeedsAdapter(presenter.getEvents(), true) }
|
||||
private var onLoadMore: OnLoadMore<String>? = null
|
||||
|
||||
@ -9,6 +9,8 @@ import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.annotation.StringRes;
|
||||
import android.support.transition.AutoTransition;
|
||||
import android.support.transition.Transition;
|
||||
import android.support.transition.TransitionManager;
|
||||
import android.support.v4.widget.NestedScrollView;
|
||||
import android.support.v7.widget.CardView;
|
||||
@ -38,7 +40,6 @@ import com.fastaccess.ui.modules.profile.ProfilePagerMvp;
|
||||
import com.fastaccess.ui.widgets.AvatarLayout;
|
||||
import com.fastaccess.ui.widgets.FontTextView;
|
||||
import com.fastaccess.ui.widgets.SpannableBuilder;
|
||||
import com.fastaccess.ui.widgets.contributions.ContributionsDay;
|
||||
import com.fastaccess.ui.widgets.contributions.GitHubContributionsView;
|
||||
import com.fastaccess.ui.widgets.recyclerview.DynamicRecyclerView;
|
||||
import com.fastaccess.ui.widgets.recyclerview.layout_manager.GridManager;
|
||||
@ -128,7 +129,6 @@ public class ProfileOverviewFragment extends BaseFragment<ProfileOverviewMvp.Vie
|
||||
|
||||
@Override protected void onFragmentCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
onInitOrgs(getPresenter().getOrgs());
|
||||
onInitContributions(getPresenter().getContributions());
|
||||
if (savedInstanceState == null) {
|
||||
getPresenter().onFragmentCreated(getArguments());
|
||||
} else {
|
||||
@ -151,6 +151,35 @@ public class ProfileOverviewFragment extends BaseFragment<ProfileOverviewMvp.Vie
|
||||
@SuppressLint("ClickableViewAccessibility") @Override public void onInitViews(@Nullable User userModel) {
|
||||
progress.setVisibility(GONE);
|
||||
if (userModel == null) return;
|
||||
if (getView() != null) {
|
||||
if (this.userModel == null) {
|
||||
TransitionManager.beginDelayedTransition((ViewGroup) getView(),
|
||||
new AutoTransition().addListener(new Transition.TransitionListener() {
|
||||
|
||||
@Override public void onTransitionStart(@NonNull Transition transition) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onTransitionEnd(@NonNull Transition transition) {
|
||||
if (contributionView != null) getPresenter().onLoadContributionWidget(contributionView);
|
||||
}
|
||||
|
||||
@Override public void onTransitionCancel(@NonNull Transition transition) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onTransitionPause(@NonNull Transition transition) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onTransitionResume(@NonNull Transition transition) {
|
||||
|
||||
}
|
||||
}));
|
||||
} else {
|
||||
getPresenter().onLoadContributionWidget(contributionView);
|
||||
}
|
||||
}
|
||||
this.userModel = userModel;
|
||||
followBtn.setVisibility(!isMeOrOrganization() ? VISIBLE : GONE);
|
||||
username.setText(userModel.getLogin());
|
||||
@ -188,9 +217,6 @@ public class ProfileOverviewFragment extends BaseFragment<ProfileOverviewMvp.Vie
|
||||
if (InputHelper.isEmpty(userModel.getCreatedAt())) {
|
||||
joined.setVisibility(GONE);
|
||||
}
|
||||
if (getView() != null) {
|
||||
TransitionManager.beginDelayedTransition((ViewGroup) getView());
|
||||
}
|
||||
followers.setText(SpannableBuilder.builder()
|
||||
.append(getString(R.string.followers))
|
||||
.append("\n")
|
||||
@ -211,15 +237,12 @@ public class ProfileOverviewFragment extends BaseFragment<ProfileOverviewMvp.Vie
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void onInitContributions(@Nullable List<ContributionsDay> items) {
|
||||
if (items != null && !items.isEmpty()) {
|
||||
contributionView.onResponse(items);
|
||||
contributionCard.setVisibility(VISIBLE);
|
||||
contributionsCaption.setVisibility(VISIBLE);
|
||||
} else {
|
||||
contributionCard.setVisibility(GONE);
|
||||
contributionsCaption.setVisibility(GONE);
|
||||
@Override public void onInitContributions(boolean show) {
|
||||
if (show) {
|
||||
contributionView.onResponse();
|
||||
}
|
||||
contributionCard.setVisibility(show ? VISIBLE : GONE);
|
||||
contributionsCaption.setVisibility(show ? VISIBLE : GONE);
|
||||
}
|
||||
|
||||
@Override public void onInitOrgs(@Nullable List<User> orgs) {
|
||||
|
||||
@ -8,6 +8,7 @@ import android.support.annotation.Nullable;
|
||||
import com.fastaccess.data.dao.model.User;
|
||||
import com.fastaccess.ui.base.mvp.BaseMvp;
|
||||
import com.fastaccess.ui.widgets.contributions.ContributionsDay;
|
||||
import com.fastaccess.ui.widgets.contributions.GitHubContributionsView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -23,7 +24,7 @@ public interface ProfileOverviewMvp {
|
||||
|
||||
void invalidateFollowBtn();
|
||||
|
||||
void onInitContributions(@Nullable List<ContributionsDay> items);
|
||||
void onInitContributions(boolean show);
|
||||
|
||||
void onInitOrgs(@Nullable List<User> orgs);
|
||||
|
||||
@ -50,6 +51,8 @@ public interface ProfileOverviewMvp {
|
||||
|
||||
void onSendUserToView(@Nullable User userModel);
|
||||
|
||||
void onLoadContributionWidget(@NonNull GitHubContributionsView view);
|
||||
|
||||
@NonNull ArrayList<User> getOrgs();
|
||||
|
||||
@NonNull ArrayList<ContributionsDay> getContributions();
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.fastaccess.ui.modules.profile.overview;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
@ -14,8 +15,10 @@ import com.fastaccess.provider.rest.RestProvider;
|
||||
import com.fastaccess.ui.base.mvp.presenter.BasePresenter;
|
||||
import com.fastaccess.ui.widgets.contributions.ContributionsDay;
|
||||
import com.fastaccess.ui.widgets.contributions.ContributionsProvider;
|
||||
import com.fastaccess.ui.widgets.contributions.GitHubContributionsView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
|
||||
@ -89,7 +92,6 @@ class ProfileOverviewPresenter extends BasePresenter<ProfileOverviewMvp.View> im
|
||||
if (userModel.getType() != null && userModel.getType().equalsIgnoreCase("user")) {
|
||||
onCheckFollowStatus(login);
|
||||
}
|
||||
loadContributions();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -107,6 +109,21 @@ class ProfileOverviewPresenter extends BasePresenter<ProfileOverviewMvp.View> im
|
||||
sendToView(view -> view.onInitViews(userModel));
|
||||
}
|
||||
|
||||
@Override public void onLoadContributionWidget(@NonNull GitHubContributionsView gitHubContributionsView) {
|
||||
if (contributions == null || contributions.isEmpty()) {
|
||||
String url = String.format(URL, login);
|
||||
manageDisposable(RxHelper.getObserver(RestProvider.getContribution().getContributions(url))
|
||||
.flatMap(s -> Observable.just(new ContributionsProvider().getContributions(s)))
|
||||
.subscribe(lists -> {
|
||||
contributions.clear();
|
||||
contributions.addAll(lists);
|
||||
loadContributions(contributions, gitHubContributionsView);
|
||||
}, Throwable::printStackTrace));
|
||||
} else {
|
||||
loadContributions(contributions, gitHubContributionsView);
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull @Override public ArrayList<User> getOrgs() {
|
||||
return userOrgs;
|
||||
}
|
||||
@ -119,15 +136,11 @@ class ProfileOverviewPresenter extends BasePresenter<ProfileOverviewMvp.View> im
|
||||
return login;
|
||||
}
|
||||
|
||||
private void loadContributions() {
|
||||
String url = String.format(URL, login);
|
||||
manageDisposable(RxHelper.getObserver(RestProvider.getContribution().getContributions(url))
|
||||
.flatMap(s -> Observable.just(new ContributionsProvider().getContributions(s)))
|
||||
.subscribe(lists -> {
|
||||
contributions.clear();
|
||||
contributions.addAll(lists);
|
||||
sendToView(view -> view.onInitContributions(contributions));
|
||||
}, Throwable::printStackTrace));
|
||||
private void loadContributions(ArrayList<ContributionsDay> contributions, GitHubContributionsView gitHubContributionsView) {
|
||||
List<ContributionsDay> filter = gitHubContributionsView.getLastContributions(contributions);
|
||||
Observable<Bitmap> bitmapObservable = Observable.just(gitHubContributionsView.drawOnCanvas(filter, contributions));
|
||||
manageObservable(bitmapObservable
|
||||
.doOnNext(bitmap -> sendToView(view -> view.onInitContributions(bitmap != null))));
|
||||
}
|
||||
|
||||
private void loadOrgs() {
|
||||
@ -141,4 +154,5 @@ class ProfileOverviewPresenter extends BasePresenter<ProfileOverviewMvp.View> im
|
||||
sendToView(view -> view.onInitOrgs(userOrgs));
|
||||
}, Throwable::printStackTrace));
|
||||
}
|
||||
|
||||
}
|
||||
@ -41,9 +41,12 @@ public class ProfileReposFilterBottomSheetDialog extends BaseBottomSheetDialog {
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
ArrayAdapter<String> typesAdapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, currentFilterOptions.getTypesList());
|
||||
ArrayAdapter<String> sortOptionsAdapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, currentFilterOptions.getSortOptionList());
|
||||
ArrayAdapter<String> sortDirectionAdapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, currentFilterOptions.getSortDirectionList());
|
||||
ArrayAdapter<String> typesAdapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, currentFilterOptions.getTypesList
|
||||
());
|
||||
ArrayAdapter<String> sortOptionsAdapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, currentFilterOptions
|
||||
.getSortOptionList());
|
||||
ArrayAdapter<String> sortDirectionAdapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, currentFilterOptions
|
||||
.getSortDirectionList());
|
||||
typeSelectionSpinner.setAdapter(typesAdapter);
|
||||
sortSelectionSpinner.setAdapter(sortOptionsAdapter);
|
||||
sortDirectionSpinner.setAdapter(sortDirectionAdapter);
|
||||
@ -104,8 +107,7 @@ public class ProfileReposFilterBottomSheetDialog extends BaseBottomSheetDialog {
|
||||
sortSelectionSpinner.setSelection(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
@Override public void dismiss() {
|
||||
currentFilterOptions = null;
|
||||
super.dismiss();
|
||||
}
|
||||
@ -116,8 +118,11 @@ public class ProfileReposFilterBottomSheetDialog extends BaseBottomSheetDialog {
|
||||
|
||||
public interface ProfileReposFilterChangeListener {
|
||||
void onFilterApply();
|
||||
|
||||
void onTypeSelected(String selectedType);
|
||||
|
||||
void onSortOptionSelected(String selectedSortOption);
|
||||
|
||||
void onSortDirectionSelected(String selectedSortDirection);
|
||||
}
|
||||
}
|
||||
|
||||
@ -501,6 +501,12 @@ public class RepoPagerActivity extends BaseActivity<RepoPagerMvp.View, RepoPager
|
||||
return userInteracted;
|
||||
}
|
||||
|
||||
@Override public void disableIssueTab() {
|
||||
showMessage(R.string.error, R.string.repo_issues_is_disabled);
|
||||
bottomNavigation.setMenuItemEnabled(1, false);
|
||||
bottomNavigation.setSelectedIndex(this.navType, true);
|
||||
}
|
||||
|
||||
@Override public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.repo_menu, menu);
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
@ -629,6 +635,6 @@ public class RepoPagerActivity extends BaseActivity<RepoPagerMvp.View, RepoPager
|
||||
}
|
||||
|
||||
private void updatePinnedRepo() {
|
||||
getPresenter().updatePinned((int) InputHelper.toLong(forkRepo),(int)InputHelper.toLong(starRepo),(int)InputHelper.toLong(watchRepo));
|
||||
getPresenter().updatePinned((int) InputHelper.toLong(forkRepo), (int) InputHelper.toLong(starRepo), (int) InputHelper.toLong(watchRepo));
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,6 +65,8 @@ public interface RepoPagerMvp {
|
||||
|
||||
|
||||
boolean hasUserInteractedWithView();
|
||||
|
||||
void disableIssueTab();
|
||||
}
|
||||
|
||||
interface Presenter extends BaseMvp.FAPresenter, BottomNavigation.OnMenuItemSelectionListener {
|
||||
|
||||
@ -268,7 +268,7 @@ class RepoPagerPresenter extends BasePresenter<RepoPagerMvp.View> implements Rep
|
||||
|
||||
@Override public void onMenuItemSelect(@IdRes int id, int position, boolean fromUser) {
|
||||
if (id == R.id.issues && (getRepo() != null && !getRepo().isHasIssues())) {
|
||||
sendToView(view -> view.showMessage(R.string.error, R.string.repo_issues_is_disabled));
|
||||
sendToView(RepoPagerMvp.View::disableIssueTab);
|
||||
return;
|
||||
}
|
||||
if (getView() != null && isViewAttached() && fromUser) {
|
||||
|
||||
@ -4,6 +4,7 @@ import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.annotation.StringRes;
|
||||
import android.support.design.widget.AppBarLayout;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
@ -16,12 +17,14 @@ import com.fastaccess.helper.ActivityHelper;
|
||||
import com.fastaccess.helper.BundleConstant;
|
||||
import com.fastaccess.helper.Bundler;
|
||||
import com.fastaccess.helper.InputHelper;
|
||||
import com.fastaccess.helper.Logger;
|
||||
import com.fastaccess.helper.PrefGetter;
|
||||
import com.fastaccess.ui.base.BaseFragment;
|
||||
import com.fastaccess.ui.widgets.StateLayout;
|
||||
import com.prettifier.pretty.PrettifyWebView;
|
||||
|
||||
import butterknife.BindView;
|
||||
import it.sephiroth.android.library.bottomnavigation.BottomNavigation;
|
||||
|
||||
/**
|
||||
* Created by Kosh on 28 Nov 2016, 9:27 PM
|
||||
@ -34,6 +37,9 @@ public class ViewerFragment extends BaseFragment<ViewerMvp.View, ViewerPresenter
|
||||
@BindView(R.id.readmeLoader) ProgressBar loader;
|
||||
@BindView(R.id.webView) PrettifyWebView webView;
|
||||
@BindView(R.id.stateLayout) StateLayout stateLayout;
|
||||
private AppBarLayout appBarLayout;
|
||||
private BottomNavigation bottomNavigation;
|
||||
private boolean scrolledTop = true;
|
||||
@State boolean isWrap = PrefGetter.isWrapCode();
|
||||
|
||||
public static ViewerFragment newInstance(@NonNull String url) {
|
||||
@ -101,6 +107,7 @@ public class ViewerFragment extends BaseFragment<ViewerMvp.View, ViewerPresenter
|
||||
@Override public void hideProgress() {
|
||||
loader.setVisibility(View.GONE);
|
||||
stateLayout.hideProgress();
|
||||
stateLayout.showReload(getPresenter().downloadedStream() == null ? 0 : 1);
|
||||
}
|
||||
|
||||
@Override public void showErrorMessage(@NonNull String msgRes) {
|
||||
@ -138,6 +145,24 @@ public class ViewerFragment extends BaseFragment<ViewerMvp.View, ViewerPresenter
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void onScrollChanged(boolean reachedTop, int scroll) {
|
||||
if (getPresenter().isRepo()) {
|
||||
if (appBarLayout != null && bottomNavigation != null) {
|
||||
Logger.e(scroll, appBarLayout.getTotalScrollRange());
|
||||
if (scroll == 0) {
|
||||
scrolledTop = true;
|
||||
bottomNavigation.setExpanded(true, false);
|
||||
appBarLayout.setExpanded(true, false);
|
||||
} else if (scroll >= appBarLayout.getTotalScrollRange() && scrolledTop) {
|
||||
bottomNavigation.setExpanded(false, false);
|
||||
appBarLayout.setExpanded(false, false);
|
||||
scrolledTop = false;
|
||||
}
|
||||
webView.setNestedScrollingEnabled(scroll < 800);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setHasOptionsMenu(true);
|
||||
@ -154,6 +179,15 @@ public class ViewerFragment extends BaseFragment<ViewerMvp.View, ViewerPresenter
|
||||
}
|
||||
}
|
||||
getActivity().invalidateOptionsMenu();
|
||||
stateLayout.setEmptyText(R.string.no_data);
|
||||
if (savedInstanceState == null) {
|
||||
stateLayout.showReload(0);
|
||||
}
|
||||
stateLayout.setOnReloadListener(view1 -> getPresenter().onHandleIntent(getArguments()));
|
||||
if (getPresenter().isRepo()) {
|
||||
appBarLayout = (AppBarLayout) getActivity().findViewById(R.id.appbar);
|
||||
bottomNavigation = (BottomNavigation) getActivity().findViewById(R.id.bottomNavigation);
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
@ -188,4 +222,11 @@ public class ViewerFragment extends BaseFragment<ViewerMvp.View, ViewerPresenter
|
||||
super.onScrollTop(index);
|
||||
if (webView != null) webView.scrollTo(0, 0);
|
||||
}
|
||||
|
||||
@Override public void setUserVisibleHint(boolean isVisibleToUser) {
|
||||
super.setUserVisibleHint(isVisibleToUser);
|
||||
if (!isVisibleToUser && appBarLayout != null) {
|
||||
appBarLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,7 +33,9 @@ class ViewerPresenter extends BasePresenter<ViewerMvp.View> implements ViewerMvp
|
||||
throwable.printStackTrace();
|
||||
int code = RestProvider.getErrorCode(throwable);
|
||||
if (code == 404) {
|
||||
sendToView(view -> view.onShowError(isRepo ? R.string.no_readme_found : R.string.no_file_found));
|
||||
if (!isRepo) {
|
||||
sendToView(view -> view.onShowError(R.string.no_file_found));
|
||||
}
|
||||
} else {
|
||||
if (code == 406) {
|
||||
sendToView(view -> view.openUrl(url));
|
||||
|
||||
@ -8,7 +8,7 @@ import android.os.Bundle
|
||||
import android.support.v4.view.ViewPager
|
||||
import android.view.View
|
||||
import android.view.ViewAnimationUtils
|
||||
import butterknife.bindView
|
||||
import com.fastaccess.ui.widgets.bindView
|
||||
import com.fastaccess.R
|
||||
import com.fastaccess.data.dao.FragmentPagerAdapterModel
|
||||
import com.fastaccess.helper.PrefGetter
|
||||
|
||||
@ -23,8 +23,8 @@ import com.fastaccess.ui.widgets.SpannableBuilder
|
||||
|
||||
class ThemeFragment : BaseFragment<ThemeFragmentMvp.View, ThemeFragmentPresenter>(), ThemeFragmentMvp.View {
|
||||
|
||||
val apply: FloatingActionButton by lazy { view!!.findViewById<FloatingActionButton>(R.id.apply) }
|
||||
val toolbar: Toolbar by lazy { view!!.findViewById<Toolbar>(R.id.toolbar) }
|
||||
val apply: FloatingActionButton by lazy { view!!.findViewById(R.id.apply) as FloatingActionButton }
|
||||
val toolbar: Toolbar by lazy { view!!.findViewById(R.id.toolbar) as Toolbar }
|
||||
|
||||
private var primaryDarkColor: Int = 0
|
||||
private var theme: Int = 0
|
||||
@ -46,22 +46,7 @@ class ThemeFragment : BaseFragment<ThemeFragmentMvp.View, ThemeFragmentPresenter
|
||||
|
||||
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||
apply.setOnClickListener {
|
||||
when (theme) {
|
||||
R.style.ThemeLight -> {
|
||||
PrefHelper.set("appTheme", getString(R.string.light_theme_mode))
|
||||
themeListener?.onThemeApplied()
|
||||
}
|
||||
R.style.ThemeDark -> {
|
||||
PrefHelper.set("appTheme", getString(R.string.dark_theme_mode))
|
||||
themeListener?.onThemeApplied()
|
||||
}
|
||||
else -> if (PrefGetter.isAmlodEnabled() || PrefGetter.isProEnabled()) {
|
||||
PrefHelper.set("appTheme", getString(R.string.amlod_theme_mode))
|
||||
themeListener?.onThemeApplied()
|
||||
} else {
|
||||
DonateActivity.Companion.start(this, getString(R.string.amlod_theme_purchase))
|
||||
}
|
||||
}
|
||||
setTheme()
|
||||
}
|
||||
if (isPremiumTheme()) {
|
||||
toolbar.title = SpannableBuilder.builder().foreground(getString(R.string.premium_theme), Color.RED)
|
||||
@ -69,8 +54,6 @@ class ThemeFragment : BaseFragment<ThemeFragmentMvp.View, ThemeFragmentPresenter
|
||||
toolbar.setNavigationOnClickListener { activity.onBackPressed() }
|
||||
}
|
||||
|
||||
private fun isPremiumTheme(): Boolean = theme == R.style.ThemeAmlod
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
super.onCreateView(inflater, container, savedInstanceState)
|
||||
theme = arguments.getInt(BundleConstant.ITEM)
|
||||
@ -97,7 +80,7 @@ class ThemeFragment : BaseFragment<ThemeFragmentMvp.View, ThemeFragmentPresenter
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
if (resultCode == Activity.RESULT_OK) {
|
||||
if (PrefGetter.isProEnabled() || PrefGetter.isAmlodEnabled()) {
|
||||
if (PrefGetter.isProEnabled() || PrefGetter.isMidNightBlueThemeEnabled() || PrefGetter.isAmlodEnabled()) {
|
||||
themeListener?.onThemeApplied()
|
||||
}
|
||||
}
|
||||
@ -112,4 +95,36 @@ class ThemeFragment : BaseFragment<ThemeFragmentMvp.View, ThemeFragmentPresenter
|
||||
return fragment
|
||||
}
|
||||
}
|
||||
|
||||
private fun setTheme() {
|
||||
when (theme) {
|
||||
R.style.ThemeLight -> {
|
||||
PrefHelper.set("appTheme", getString(R.string.light_theme_mode))
|
||||
themeListener?.onThemeApplied()
|
||||
}
|
||||
R.style.ThemeDark -> {
|
||||
PrefHelper.set("appTheme", getString(R.string.dark_theme_mode))
|
||||
themeListener?.onThemeApplied()
|
||||
}
|
||||
R.style.ThemeAmlod -> {
|
||||
if (PrefGetter.isAmlodEnabled() || PrefGetter.isProEnabled()) {
|
||||
PrefHelper.set("appTheme", getString(R.string.amlod_theme_mode))
|
||||
themeListener?.onThemeApplied()
|
||||
} else {
|
||||
DonateActivity.start(this, getString(R.string.amlod_theme_purchase))
|
||||
}
|
||||
}
|
||||
R.style.ThemeMidNighBlue -> {
|
||||
if (PrefGetter.isAmlodEnabled() || PrefGetter.isProEnabled()) {
|
||||
PrefHelper.set("appTheme", getString(R.string.mid_night_blue_theme_mode))
|
||||
themeListener?.onThemeApplied()
|
||||
} else {
|
||||
DonateActivity.start(this, getString(R.string.midnight_blue_theme_purchase))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun isPremiumTheme(): Boolean = theme == R.style.ThemeAmlod || theme == R.style.ThemeMidNighBlue
|
||||
|
||||
}
|
||||
|
||||
@ -9,7 +9,6 @@ import android.view.Gravity
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.widget.TextView
|
||||
import butterknife.bindView
|
||||
import com.evernote.android.state.State
|
||||
import com.fastaccess.R
|
||||
import com.fastaccess.helper.BundleConstant
|
||||
@ -18,6 +17,7 @@ import com.fastaccess.helper.Logger
|
||||
import com.fastaccess.ui.base.BaseActivity
|
||||
import com.fastaccess.ui.modules.main.MainActivity
|
||||
import com.fastaccess.ui.modules.trending.fragment.TrendingFragment
|
||||
import com.fastaccess.ui.widgets.bindView
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -3,7 +3,6 @@ package com.fastaccess.ui.modules.trending.fragment
|
||||
import android.os.Bundle
|
||||
import android.support.v4.widget.SwipeRefreshLayout
|
||||
import android.view.View
|
||||
import butterknife.bindView
|
||||
import com.evernote.android.state.State
|
||||
import com.fastaccess.R
|
||||
import com.fastaccess.data.dao.TrendingModel
|
||||
@ -18,9 +17,9 @@ import com.fastaccess.ui.widgets.recyclerview.DynamicRecyclerView
|
||||
|
||||
class TrendingFragment : BaseFragment<TrendingFragmentMvp.View, TrendingFragmentPresenter>(), TrendingFragmentMvp.View {
|
||||
|
||||
val recycler: DynamicRecyclerView by lazy { view!!.findViewById<DynamicRecyclerView>(R.id.recycler) }
|
||||
val refresh: SwipeRefreshLayout by lazy { view!!.findViewById<SwipeRefreshLayout>(R.id.refresh) }
|
||||
val stateLayout: StateLayout by lazy { view!!.findViewById<StateLayout>(R.id.stateLayout) }
|
||||
val recycler: DynamicRecyclerView by lazy { view!!.findViewById(R.id.recycler) as DynamicRecyclerView }
|
||||
val refresh: SwipeRefreshLayout by lazy { view!!.findViewById(R.id.refresh) as SwipeRefreshLayout }
|
||||
val stateLayout: StateLayout by lazy { view!!.findViewById(R.id.stateLayout) as StateLayout }
|
||||
val adapter by lazy { TrendingAdapter(presenter.getTendingList()) }
|
||||
|
||||
@State var lang: String = ""
|
||||
|
||||
130
app/src/main/java/com/fastaccess/ui/widgets/ButterKnife.kt
Normal file
130
app/src/main/java/com/fastaccess/ui/widgets/ButterKnife.kt
Normal file
@ -0,0 +1,130 @@
|
||||
package com.fastaccess.ui.widgets
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.Dialog
|
||||
import android.app.DialogFragment
|
||||
import android.app.Fragment
|
||||
import android.support.v7.widget.RecyclerView.ViewHolder
|
||||
import android.view.View
|
||||
import kotlin.properties.ReadOnlyProperty
|
||||
import kotlin.reflect.KProperty
|
||||
import android.support.v4.app.DialogFragment as SupportDialogFragment
|
||||
import android.support.v4.app.Fragment as SupportFragment
|
||||
|
||||
public fun <V : View> View.bindView(id: Int)
|
||||
: ReadOnlyProperty<View, V> = required(id, viewFinder)
|
||||
public fun <V : View> Activity.bindView(id: Int)
|
||||
: ReadOnlyProperty<Activity, V> = required(id, viewFinder)
|
||||
public fun <V : View> Dialog.bindView(id: Int)
|
||||
: ReadOnlyProperty<Dialog, V> = required(id, viewFinder)
|
||||
public fun <V : View> DialogFragment.bindView(id: Int)
|
||||
: ReadOnlyProperty<DialogFragment, V> = required(id, viewFinder)
|
||||
public fun <V : View> android.support.v4.app.DialogFragment.bindView(id: Int)
|
||||
: ReadOnlyProperty<android.support.v4.app.DialogFragment, V> = required(id, viewFinder)
|
||||
public fun <V : View> Fragment.bindView(id: Int)
|
||||
: ReadOnlyProperty<Fragment, V> = required(id, viewFinder)
|
||||
public fun <V : View> android.support.v4.app.Fragment.bindView(id: Int)
|
||||
: ReadOnlyProperty<android.support.v4.app.Fragment, V> = required(id, viewFinder)
|
||||
public fun <V : View> ViewHolder.bindView(id: Int)
|
||||
: ReadOnlyProperty<ViewHolder, V> = required(id, viewFinder)
|
||||
|
||||
public fun <V : View> View.bindOptionalView(id: Int)
|
||||
: ReadOnlyProperty<View, V?> = optional(id, viewFinder)
|
||||
public fun <V : View> Activity.bindOptionalView(id: Int)
|
||||
: ReadOnlyProperty<Activity, V?> = optional(id, viewFinder)
|
||||
public fun <V : View> Dialog.bindOptionalView(id: Int)
|
||||
: ReadOnlyProperty<Dialog, V?> = optional(id, viewFinder)
|
||||
public fun <V : View> DialogFragment.bindOptionalView(id: Int)
|
||||
: ReadOnlyProperty<DialogFragment, V?> = optional(id, viewFinder)
|
||||
public fun <V : View> android.support.v4.app.DialogFragment.bindOptionalView(id: Int)
|
||||
: ReadOnlyProperty<android.support.v4.app.DialogFragment, V?> = optional(id, viewFinder)
|
||||
public fun <V : View> Fragment.bindOptionalView(id: Int)
|
||||
: ReadOnlyProperty<Fragment, V?> = optional(id, viewFinder)
|
||||
public fun <V : View> android.support.v4.app.Fragment.bindOptionalView(id: Int)
|
||||
: ReadOnlyProperty<android.support.v4.app.Fragment, V?> = optional(id, viewFinder)
|
||||
public fun <V : View> ViewHolder.bindOptionalView(id: Int)
|
||||
: ReadOnlyProperty<ViewHolder, V?> = optional(id, viewFinder)
|
||||
|
||||
public fun <V : View> View.bindViews(vararg ids: Int)
|
||||
: ReadOnlyProperty<View, List<V>> = required(ids, viewFinder)
|
||||
public fun <V : View> Activity.bindViews(vararg ids: Int)
|
||||
: ReadOnlyProperty<Activity, List<V>> = required(ids, viewFinder)
|
||||
public fun <V : View> Dialog.bindViews(vararg ids: Int)
|
||||
: ReadOnlyProperty<Dialog, List<V>> = required(ids, viewFinder)
|
||||
public fun <V : View> DialogFragment.bindViews(vararg ids: Int)
|
||||
: ReadOnlyProperty<DialogFragment, List<V>> = required(ids, viewFinder)
|
||||
public fun <V : View> android.support.v4.app.DialogFragment.bindViews(vararg ids: Int)
|
||||
: ReadOnlyProperty<android.support.v4.app.DialogFragment, List<V>> = required(ids, viewFinder)
|
||||
public fun <V : View> Fragment.bindViews(vararg ids: Int)
|
||||
: ReadOnlyProperty<Fragment, List<V>> = required(ids, viewFinder)
|
||||
public fun <V : View> android.support.v4.app.Fragment.bindViews(vararg ids: Int)
|
||||
: ReadOnlyProperty<android.support.v4.app.Fragment, List<V>> = required(ids, viewFinder)
|
||||
public fun <V : View> ViewHolder.bindViews(vararg ids: Int)
|
||||
: ReadOnlyProperty<ViewHolder, List<V>> = required(ids, viewFinder)
|
||||
|
||||
public fun <V : View> View.bindOptionalViews(vararg ids: Int)
|
||||
: ReadOnlyProperty<View, List<V>> = optional(ids, viewFinder)
|
||||
public fun <V : View> Activity.bindOptionalViews(vararg ids: Int)
|
||||
: ReadOnlyProperty<Activity, List<V>> = optional(ids, viewFinder)
|
||||
public fun <V : View> Dialog.bindOptionalViews(vararg ids: Int)
|
||||
: ReadOnlyProperty<Dialog, List<V>> = optional(ids, viewFinder)
|
||||
public fun <V : View> DialogFragment.bindOptionalViews(vararg ids: Int)
|
||||
: ReadOnlyProperty<DialogFragment, List<V>> = optional(ids, viewFinder)
|
||||
public fun <V : View> android.support.v4.app.DialogFragment.bindOptionalViews(vararg ids: Int)
|
||||
: ReadOnlyProperty<android.support.v4.app.DialogFragment, List<V>> = optional(ids, viewFinder)
|
||||
public fun <V : View> Fragment.bindOptionalViews(vararg ids: Int)
|
||||
: ReadOnlyProperty<Fragment, List<V>> = optional(ids, viewFinder)
|
||||
public fun <V : View> android.support.v4.app.Fragment.bindOptionalViews(vararg ids: Int)
|
||||
: ReadOnlyProperty<android.support.v4.app.Fragment, List<V>> = optional(ids, viewFinder)
|
||||
public fun <V : View> ViewHolder.bindOptionalViews(vararg ids: Int)
|
||||
: ReadOnlyProperty<ViewHolder, List<V>> = optional(ids, viewFinder)
|
||||
|
||||
private val View.viewFinder: View.(Int) -> View?
|
||||
get() = { findViewById(it) }
|
||||
private val Activity.viewFinder: Activity.(Int) -> View?
|
||||
get() = { findViewById(it) }
|
||||
private val Dialog.viewFinder: Dialog.(Int) -> View?
|
||||
get() = { findViewById(it) }
|
||||
private val DialogFragment.viewFinder: DialogFragment.(Int) -> View?
|
||||
get() = { dialog.findViewById(it) }
|
||||
private val android.support.v4.app.DialogFragment.viewFinder: android.support.v4.app.DialogFragment.(Int) -> View?
|
||||
get() = { dialog.findViewById(it) }
|
||||
private val Fragment.viewFinder: Fragment.(Int) -> View?
|
||||
get() = { view.findViewById(it) }
|
||||
private val android.support.v4.app.Fragment.viewFinder: android.support.v4.app.Fragment.(Int) -> View?
|
||||
get() = { view!!.findViewById(it) }
|
||||
private val ViewHolder.viewFinder: ViewHolder.(Int) -> View?
|
||||
get() = { itemView.findViewById(it) }
|
||||
|
||||
private fun viewNotFound(id:Int, desc: KProperty<*>): Nothing =
|
||||
throw IllegalStateException("View ID $id for '${desc.name}' not found.")
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
private fun <T, V : View> required(id: Int, finder: T.(Int) -> View?)
|
||||
= Lazy { t: T, desc -> t.finder(id) as V? ?: viewNotFound(id, desc) }
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
private fun <T, V : View> optional(id: Int, finder: T.(Int) -> View?)
|
||||
= Lazy { t: T, desc -> t.finder(id) as V? }
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
private fun <T, V : View> required(ids: IntArray, finder: T.(Int) -> View?)
|
||||
= Lazy { t: T, desc -> ids.map { t.finder(it) as V? ?: viewNotFound(it, desc) } }
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
private fun <T, V : View> optional(ids: IntArray, finder: T.(Int) -> View?)
|
||||
= Lazy { t: T, desc -> ids.map { t.finder(it) as V? }.filterNotNull() }
|
||||
|
||||
// Like Kotlin's lazy delegate but the initializer gets the target and metadata passed to it
|
||||
private class Lazy<T, V>(private val initializer: (T, KProperty<*>) -> V) : ReadOnlyProperty<T, V> {
|
||||
private object EMPTY
|
||||
private var value: Any? = EMPTY
|
||||
|
||||
override fun getValue(thisRef: T, property: KProperty<*>): V {
|
||||
if (value == EMPTY) {
|
||||
value = initializer(thisRef, property)
|
||||
}
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
return value as V
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,115 @@
|
||||
package com.fastaccess.ui.widgets;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.support.v7.preference.PreferenceViewHolder;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.TypedValue;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.fastaccess.R;
|
||||
import com.fastaccess.helper.PrefGetter;
|
||||
import com.fastaccess.helper.ViewHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import petrov.kristiyan.colorpicker.ColorPicker;
|
||||
|
||||
/**
|
||||
* Created by Hamad on 6/11/17.
|
||||
*/
|
||||
|
||||
public class ColorPickerPreference extends Preference implements ColorPicker.OnChooseColorListener {
|
||||
|
||||
private ColorPicker colorPicker;
|
||||
|
||||
public ColorPickerPreference(Context context) {
|
||||
super(context);
|
||||
init();
|
||||
}
|
||||
|
||||
public ColorPickerPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
init();
|
||||
}
|
||||
|
||||
public ColorPickerPreference(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
init();
|
||||
}
|
||||
|
||||
public ColorPickerPreference(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
setWidgetLayoutResource(R.layout.preference_widget_color);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onClick() {
|
||||
super.onClick();
|
||||
|
||||
int selected_color = getSelected_color();
|
||||
String title = String.format("Accent Color: (Currently: %s)", getSelected_color_name());
|
||||
colorPicker = new ColorPicker(getContext());
|
||||
colorPicker.setRoundColorButton(true);
|
||||
colorPicker.setColors(R.array.theme_colors_hex);
|
||||
colorPicker.setDefaultColorButton(selected_color);
|
||||
colorPicker.setTitle(title);
|
||||
TextView title_tv = (TextView) colorPicker.getDialogViewLayout().findViewById(R.id.title);
|
||||
title_tv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
|
||||
colorPicker.getPositiveButton().setTextColor(ViewHelper.getAccentColor(getContext()));
|
||||
colorPicker.getNegativeButton().setTextColor(ViewHelper.getPrimaryTextColor(getContext()));
|
||||
colorPicker.setOnChooseColorListener(this);
|
||||
colorPicker.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(PreferenceViewHolder holder) {
|
||||
super.onBindViewHolder(holder);
|
||||
final Button colorButton = (Button) holder.findViewById(R.id.color);
|
||||
colorButton.setBackgroundResource(R.drawable.circle_shape);
|
||||
colorButton.getBackground().setColorFilter(getSelected_color(), PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
|
||||
private int getSelected_color() {
|
||||
TypedArray colorTypedArray = getContext().getResources().obtainTypedArray(R.array.theme_colors_hex);
|
||||
String[] colorNames = getContext().getResources().getStringArray(R.array.theme_colors);
|
||||
|
||||
ArrayList<Integer> colors = new ArrayList<>();
|
||||
for (int i = 0; i < colorTypedArray.length(); i++) {
|
||||
colors.add(colorTypedArray.getColor(i, 0));
|
||||
}
|
||||
colorTypedArray.recycle();
|
||||
HashMap<Integer, Integer> preferenceValueToColor = new HashMap<>();
|
||||
|
||||
for(int i=0; i<colorNames.length; i++){
|
||||
preferenceValueToColor.put(PrefGetter.getThemeColor(getContext().getResources(), colorNames[i]), colors.get(i));
|
||||
}
|
||||
return preferenceValueToColor.get(PrefGetter.getThemeColor(getContext()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChooseColor(int position, int color) {
|
||||
// put code
|
||||
//getOnPreferenceChangeListener().onPreferenceChange(ColorPickerPreference.this, color);
|
||||
persistString(getContext().getResources().getStringArray(R.array.theme_colors)[position]);
|
||||
getOnPreferenceChangeListener().onPreferenceChange(this, getContext().getResources().getStringArray(R.array.theme_colors)[position]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
|
||||
}
|
||||
|
||||
public String getSelected_color_name() {
|
||||
String[] colorNames = getContext().getResources().getStringArray(R.array.theme_colors);
|
||||
return colorNames[PrefGetter.getThemeColor(getContext()) - 1];
|
||||
}
|
||||
}
|
||||
@ -7,12 +7,12 @@ import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.fastaccess.R;
|
||||
import com.fastaccess.ui.widgets.contributions.utils.ColorsUtils;
|
||||
@ -26,16 +26,6 @@ import java.util.List;
|
||||
*/
|
||||
|
||||
public class GitHubContributionsView extends View {
|
||||
|
||||
private static final String INSTANCE_STATE = "saved_instance";
|
||||
private static final String INSTANCE_BASE_COLOR = "saved_base_color";
|
||||
private static final String INSTANCE_BASE_EMPTY_COLOR = "saved_base_empty_color";
|
||||
private static final String INSTANCE_BACKGROUND_BASE_COLOR = "saved_bg_base_color";
|
||||
private static final String INSTANCE_TEXT_COLOR = "saved_text_color";
|
||||
private static final String INSTANCE_DISPLAY_MONTH = "saved_display_month";
|
||||
private static final String INSTANCE_LAST_WEEKS = "saved_last_weeks";
|
||||
private static final String INSTANCE_USERNAME = "saved_username";
|
||||
|
||||
private static final String BASE_COLOR = "#D6E685"; // default of Github
|
||||
|
||||
private int baseColor = Color.parseColor(BASE_COLOR);
|
||||
@ -45,14 +35,14 @@ public class GitHubContributionsView extends View {
|
||||
private boolean displayMonth = false;
|
||||
private int lastWeeks = 53;
|
||||
private String username;
|
||||
|
||||
private List<ContributionsDay> contributions;
|
||||
private List<ContributionsDay> contributionsFilter;
|
||||
private Rect rect;
|
||||
private Paint monthTextPaint;
|
||||
private Matrix matrix = new Matrix();
|
||||
private Paint paint = new Paint();
|
||||
private Paint blockPaint;
|
||||
private Bitmap bitmap = null;
|
||||
private int height;
|
||||
private Point point = new Point();
|
||||
|
||||
public GitHubContributionsView(Context context) {
|
||||
super(context);
|
||||
@ -75,7 +65,7 @@ public class GitHubContributionsView extends View {
|
||||
}
|
||||
|
||||
private void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
|
||||
((WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getSize(point);
|
||||
final TypedArray attributes = context.getTheme().obtainStyledAttributes(
|
||||
attrs, R.styleable.GitHubContributionsView, defStyleAttr, defStyleRes);
|
||||
initAttributes(attributes);
|
||||
@ -255,59 +245,31 @@ public class GitHubContributionsView extends View {
|
||||
* Clean de component.
|
||||
*/
|
||||
public void clearContribution() {
|
||||
this.contributions = null;
|
||||
bitmap = null;
|
||||
invalidate();
|
||||
}
|
||||
|
||||
public void onResponse(List<ContributionsDay> contributionsDay) {
|
||||
this.contributions = contributionsDay;
|
||||
contributionsFilter = getLastContributions(contributions, lastWeeks);
|
||||
public void onResponse() {
|
||||
adjustHeight(height);
|
||||
invalidate();
|
||||
}
|
||||
|
||||
@Override protected Parcelable onSaveInstanceState() {
|
||||
final Bundle bundle = new Bundle();
|
||||
bundle.putParcelable(INSTANCE_STATE, super.onSaveInstanceState());
|
||||
bundle.putInt(INSTANCE_BASE_COLOR, baseColor);
|
||||
bundle.putInt(INSTANCE_BASE_EMPTY_COLOR, baseEmptyColor);
|
||||
bundle.putInt(INSTANCE_BACKGROUND_BASE_COLOR, backgroundBaseColor);
|
||||
bundle.putInt(INSTANCE_TEXT_COLOR, textColor);
|
||||
bundle.putBoolean(INSTANCE_DISPLAY_MONTH, displayMonth);
|
||||
bundle.putInt(INSTANCE_LAST_WEEKS, lastWeeks);
|
||||
bundle.putString(INSTANCE_USERNAME, username);
|
||||
return bundle;
|
||||
}
|
||||
|
||||
@Override protected void onRestoreInstanceState(Parcelable state) {
|
||||
if (state instanceof Bundle) {
|
||||
final Bundle bundle = (Bundle) state;
|
||||
baseColor = bundle.getInt(INSTANCE_BASE_COLOR);
|
||||
backgroundBaseColor = bundle.getInt(INSTANCE_BACKGROUND_BASE_COLOR);
|
||||
textColor = bundle.getInt(INSTANCE_TEXT_COLOR);
|
||||
displayMonth = bundle.getBoolean(INSTANCE_DISPLAY_MONTH);
|
||||
lastWeeks = bundle.getInt(INSTANCE_LAST_WEEKS);
|
||||
username = bundle.getString(INSTANCE_USERNAME);
|
||||
super.onRestoreInstanceState(bundle.getParcelable(INSTANCE_STATE));
|
||||
return;
|
||||
}
|
||||
super.onRestoreInstanceState(state);
|
||||
}
|
||||
|
||||
@Override protected void onDraw(Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
if (contributions != null) {
|
||||
canvas.drawBitmap(drawOnCanvas(canvas), matrix, paint);
|
||||
if (bitmap != null) {
|
||||
canvas.drawBitmap(bitmap, matrix, paint);
|
||||
} else {
|
||||
drawPlaceholder(canvas);
|
||||
}
|
||||
}
|
||||
|
||||
Bitmap bitmap = null;
|
||||
|
||||
private Bitmap drawOnCanvas(Canvas canvas) {
|
||||
public Bitmap drawOnCanvas(List<ContributionsDay> contributionsFilter, List<ContributionsDay> contributions) {
|
||||
if ((contributionsFilter == null || contributions == null) || (contributionsFilter.isEmpty() || contributions.isEmpty())) {
|
||||
return null;
|
||||
}
|
||||
if (bitmap == null) {
|
||||
canvas.getClipBounds(rect);
|
||||
int width = rect.width();
|
||||
int padding = getResources().getDimensionPixelSize(R.dimen.spacing_large);
|
||||
int width = point.x - padding;
|
||||
int verticalBlockNumber = 7;
|
||||
int horizontalBlockNumber = getHorizontalBlockNumber(contributionsFilter.size(), verticalBlockNumber);
|
||||
float marginBlock = (1.0F - 0.1F);
|
||||
@ -337,18 +299,16 @@ public class GitHubContributionsView extends View {
|
||||
// another column
|
||||
x += blockWidth + spaceWidth;
|
||||
y = topMargin + monthTextHeight;
|
||||
|
||||
if (DatesUtils.isFirstWeekOfMount(day.year, day.month, day.day + 1)) {
|
||||
canvas1.drawText(
|
||||
DatesUtils.getShortMonthName(day.year, day.month, day.day + 1),
|
||||
x, monthTextHeight, monthTextPaint);
|
||||
canvas1.drawText(DatesUtils.getShortMonthName(day.year, day.month, day.day + 1), x, monthTextHeight,
|
||||
monthTextPaint);
|
||||
}
|
||||
|
||||
} else {
|
||||
y += blockWidth + spaceWidth;
|
||||
}
|
||||
}
|
||||
adjustHeight(height);
|
||||
this.height = height;
|
||||
}
|
||||
return bitmap;
|
||||
}
|
||||
@ -362,6 +322,7 @@ public class GitHubContributionsView extends View {
|
||||
}
|
||||
|
||||
private void drawPlaceholder(Canvas canvas) {
|
||||
if (!isInEditMode()) return;
|
||||
canvas.getClipBounds(rect);
|
||||
int width = rect.width();
|
||||
|
||||
@ -410,15 +371,13 @@ public class GitHubContributionsView extends View {
|
||||
setLayoutParams(ll);
|
||||
}
|
||||
|
||||
// Static helpers
|
||||
private static int getHorizontalBlockNumber(int total, int divider) {
|
||||
public int getHorizontalBlockNumber(int total, int divider) {
|
||||
boolean isInteger = total % divider == 0;
|
||||
int result = total / divider;
|
||||
return (isInteger) ? result : result + 1;
|
||||
}
|
||||
|
||||
private static List<ContributionsDay> getLastContributions(List<ContributionsDay> contributions,
|
||||
int lastWeeks) {
|
||||
public List<ContributionsDay> getLastContributions(List<ContributionsDay> contributions) {
|
||||
int lastWeekDays = contributions.size() % 7;
|
||||
int lastDays = (lastWeekDays > 0) ? lastWeekDays + (lastWeeks - 1) * 7 : lastWeeks * 7;
|
||||
return contributions.subList(contributions.size() - lastDays, contributions.size());
|
||||
|
||||
@ -36,6 +36,8 @@ public class PrettifyWebView extends NestedWebView {
|
||||
|
||||
public interface OnContentChangedListener {
|
||||
void onContentChanged(int progress);
|
||||
|
||||
void onScrollChanged(boolean reachedTop, int scroll);
|
||||
}
|
||||
|
||||
public PrettifyWebView(Context context) {
|
||||
@ -100,6 +102,13 @@ public class PrettifyWebView extends NestedWebView {
|
||||
});
|
||||
}
|
||||
|
||||
@Override protected void onScrollChanged(int l, int t, int oldl, int oldt) {
|
||||
super.onScrollChanged(l, t, oldl, oldt);
|
||||
if (onContentChangedListener != null) {
|
||||
onContentChangedListener.onScrollChanged(t == 0, t);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean hitLinkResult(WebView.HitTestResult result) {
|
||||
return result.getType() == WebView.HitTestResult.SRC_ANCHOR_TYPE || result.getType() == HitTestResult.IMAGE_TYPE ||
|
||||
result.getType() == HitTestResult.SRC_IMAGE_ANCHOR_TYPE;
|
||||
@ -216,6 +225,6 @@ public class PrettifyWebView extends NestedWebView {
|
||||
startActivity(Uri.parse(url));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -32,6 +32,7 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:layout_gravity="center"
|
||||
android:id="@+id/color"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp" />
|
||||
</LinearLayout>
|
||||
@ -8,61 +8,26 @@
|
||||
<body id="preview">
|
||||
<h2><a id="FastHub_changelog_0"></a>FastHub changelog
|
||||
</h2>
|
||||
<h3><a id="Version__301_Trending_Improvement_2"></a>Version 3.0.1 (Trending Improvement!)
|
||||
<h3><a id="Version__310_Amlod_Theme_font_colorredPremiumfont_2"></a>Version 3.1.0 (Amlod Theme <font color="red">Premium</font>)
|
||||
</h3>
|
||||
<blockquote>
|
||||
<p>
|
||||
<strong>P.S: I’m not asking for too much, if you are facing a problem in FastHub please report it at the issue tracker in GitHub
|
||||
either via FastHub or from GitHub website, your reviews are what keeps me motivated to further improve FastHub.
|
||||
<br>
|
||||
Keep in mind that FastHub is free & open source.
|
||||
</strong>
|
||||
</p>
|
||||
</blockquote>
|
||||
<h4><a id="Bugs__Enhancements__new_Features_301_7"></a>Bugs , Enhancements & new Features (3.0.1)
|
||||
<h4><a id="Bugs__Enhancements__new_Features_301_4"></a>Bugs , Enhancements & New Features (3.1.0)
|
||||
</h4>
|
||||
<ul>
|
||||
<li>(New) Showing language to Trending list items.</li>
|
||||
<li>(Fix) Description in Trending might show in wrong place.</li>
|
||||
<li>(Fix) Large files in dark theme text color.</li>
|
||||
<li>(Fix) Notifications after migrating to RxJava2 only one were showing.</li>
|
||||
<li>(Fix) Scrolling code in Readme causes header to move as well.</li>
|
||||
<li>(Fix) Personal Gists were opening some random gist.</li>
|
||||
<li>(Enhancement) Clicking on user avatar from profile will open their image in full screen.</li>
|
||||
<li>(Enhancement) No new line shows in wrong position.</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<h4><a id="Bugs__Enhancements__new_Features_300_16"></a>Bugs , Enhancements & new Features (3.0.0)
|
||||
</h4>
|
||||
<ul>
|
||||
<li>(New) Explore trending with all the languages out there.</li>
|
||||
<li>(New) Filter Repos (Thanks to @aadithyabk)</li>
|
||||
<li>(New) See specific user feed.</li>
|
||||
<li>(New) Display amount of starred repos.</li>
|
||||
<li>(New) Copy Repo URL to clipboard</li>
|
||||
<li>(New) Added participated issue sorting to personal issue list</li>
|
||||
<li>(New) Showing multiple build statues.</li>
|
||||
<li>(New) Lithuanian language (Thanks to @mistermantas)</li>
|
||||
<li>(New) no new line at end of file now shows a picture</li>
|
||||
<li>(Enhancement/Fix) Sort issues by reaction</li>
|
||||
<li>(Fix) Issues/PRs editing, was semi-broken in preview release</li>
|
||||
<li>(Fix) Showing missing repo (broken in previous version)</li>
|
||||
<li>(Fix) Support development now works,
|
||||
<em>please use it.</em>
|
||||
<li>(New) Amlod Theme (those who has supported FastHub development will get it for free 😉 ).</li>
|
||||
<li>(New) You’ll be seeing a heart next to your name in the drawer menu to indicates that you supported FastHub before.</li>
|
||||
<li>(New) Repo readme header & footer now will disappear on scroll & only appear when you reach top to improve reading experience.</li>
|
||||
<li>(Enhancement) Feeds now should be displaying the feed almost like GitHub website.</li>
|
||||
<li>(Enhancement) Issue tab should be disabled if the Repo doesn’t have issues enabled.</li>
|
||||
<li>(Enhancement) Revamp of the whole code syntax highlighting, also now the auto scrolled line number would be highlighted.</li>
|
||||
<li>(Enhancement) Revamp of selecting Themes UI, now you should have proper display of what you going to see before applying the theme.
|
||||
</li>
|
||||
<li>(Fix) Issue count not updating.</li>
|
||||
<li>(Fix) Emoji’s were joining :crossed_swords:</li>
|
||||
<li>(Fix) Back button when opening FastHub from an external link</li>
|
||||
<li>(Fix) Issue comment were only showing up to 100 comments</li>
|
||||
<li>(Fix) Dropdown menus not closing</li>
|
||||
<li>(Fix) Some tablets had text wrapping issues</li>
|
||||
<li>(Fix) Pictures not loading in PR’s/commits</li>
|
||||
<li>(Fix) Fixed crash when adding a react</li>
|
||||
<li>(Fix) Some tooltips were incorrect</li>
|
||||
<li>(Fix) Stargazers are now updated in pinned repo’s</li>
|
||||
<li>(Fix) Gist links (edited)</li>
|
||||
<li>(Enhancement) Display accent color theme instead of text when selecting accent color. thanks to @Dreamersoul</li>
|
||||
<li>(Fix) No newline showing in wrong place.
|
||||
<em>(again)</em>
|
||||
</li>
|
||||
<li>(Fix) Clicking version number now should make a proper API call to determine if there is new update for FastHub.</li>
|
||||
<li>There are more stuff are not mentioned, find them out :p</li>
|
||||
<li>Lots of bug fixes</li>
|
||||
<li>(Fix) Lots of bug fixes</li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>Thanks to everyone who contributed either via reporting bugs or via code contribution</p>
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<resources>
|
||||
<string name="premium_theme">Aukšt. kokyb. tema</string>
|
||||
<string name="in_progress">Prašome palaukti…</string>
|
||||
<string name="action">Veiksmas</string>
|
||||
<string name="settings">Nustatymai</string>
|
||||
|
||||
@ -52,6 +52,25 @@
|
||||
<item>@string/deep_orange_theme_mode</item>
|
||||
</string-array>
|
||||
|
||||
<array name="theme_colors_hex" translatable="false">
|
||||
<item>@color/material_red_700</item>
|
||||
<item>@color/material_pink_700</item>
|
||||
<item>@color/material_purple_700</item>
|
||||
<item>@color/material_deep_purple_700</item>
|
||||
<item>@color/material_indigo_700</item>
|
||||
<item>@color/material_blue_700</item>
|
||||
<item>@color/material_light_blue_700</item>
|
||||
<item>@color/material_cyan_700</item>
|
||||
<item>@color/material_teal_700</item>
|
||||
<item>@color/material_green_700</item>
|
||||
<item>@color/material_light_green_700</item>
|
||||
<item>@color/material_lime_700</item>
|
||||
<item>@color/material_yellow_700</item>
|
||||
<item>@color/material_amber_700</item>
|
||||
<item>@color/material_orange_700</item>
|
||||
<item>@color/material_deep_orange_700</item>
|
||||
</array>
|
||||
|
||||
<string-array name="issues_filter">
|
||||
<item>@string/created</item>
|
||||
<item>@string/assigned</item>
|
||||
|
||||
@ -295,6 +295,7 @@
|
||||
<string name="light_theme_mode" translatable="false">Light Theme</string>
|
||||
<string name="dark_theme_mode" translatable="false">Dark Theme</string>
|
||||
<string name="amlod_theme_mode" translatable="false">Amlod Theme</string>
|
||||
<string name="mid_night_blue_theme_mode" translatable="false">Mid Night Blue</string>
|
||||
<string name="red_theme_mode" translatable="false">Red</string>
|
||||
<string name="pink_theme_mode" translatable="false">Pink</string>
|
||||
<string name="purple_theme_mode" translatable="false">Purple</string>
|
||||
|
||||
@ -1,19 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<color name="midNightBlueWindowBackground">#1B2837</color>
|
||||
<color name="midnightBlueWindowBackground">#FAFAFA</color>
|
||||
|
||||
<style name="ThemeMidNightBlue" parent="ThemeMidNightBlue.Base"/>
|
||||
<style name="ThemeMidNighBlue" parent="ThemeMidNighBlue.Base"/>
|
||||
|
||||
<style name="ThemeMidNightBlue.Base" parent="Theme.AppCompat.NoActionBar">
|
||||
<item name="card_background">#213040</item>
|
||||
<item name="icon_color">#eee</item>
|
||||
<item name="timeLineBackground">@style/TimeLineBackgroundMidNightBlue</item>
|
||||
<item name="patch_addition">@color/dark_patch_addition_color</item>
|
||||
<item name="patch_deletion">@color/dark_patch_deletion_color</item>
|
||||
<item name="patch_ref">@color/dark_patch_ref_color</item>
|
||||
<item name="dividerColor">@color/darkDivider</item>
|
||||
<item name="android:windowBackground">@color/midNightBlueWindowBackground</item>
|
||||
<style name="ThemeMidNighBlue.Base" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="card_background">@color/cardview_light_background</item>
|
||||
<item name="icon_color">#212121</item>
|
||||
<item name="comment_box_style">@style/CommentBoxLight</item>
|
||||
<item name="timeLineBackground">@style/TimeLineBackgroundLight</item>
|
||||
<item name="patch_addition">@color/light_patch_addition_color</item>
|
||||
<item name="patch_deletion">@color/light_patch_deletion_color</item>
|
||||
<item name="patch_ref">@color/light_patch_ref_color</item>
|
||||
<item name="dividerColor">@color/lightDivider</item>
|
||||
<item name="android:windowBackground">@color/midnightBlueWindowBackground</item>
|
||||
<item name="colorPrimary">#213040</item>
|
||||
<item name="colorPrimaryDark">#101B27</item>
|
||||
<item name="colorAccent">#4C5B6A</item>
|
||||
@ -22,99 +23,175 @@
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
|
||||
<item name="bottomSheetDialogTheme">@style/AppBottomSheetDialogTheme</item>
|
||||
<item name="android:textColorPrimary">#eee</item>
|
||||
<item name="android:textColorSecondary">#9E9E9E</item>
|
||||
<item name="android:textColorTertiary">#ffe0e0e0</item>
|
||||
<item name="android:textColorPrimary">#212121</item>
|
||||
<item name="android:textColorSecondary">#727272</item>
|
||||
<item name="android:textColorTertiary">#686868</item>
|
||||
<item name="android:windowAllowEnterTransitionOverlap">true</item>
|
||||
<item name="android:windowAllowReturnTransitionOverlap">true</item>
|
||||
<item name="android:colorEdgeEffect">?colorPrimary</item>
|
||||
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
|
||||
<item name="android:statusBarColor">@color/transparent</item>
|
||||
<item name="android:windowContentTransitions">true</item>
|
||||
<item name="android:dialogTheme">@style/DialogThemeMidNight</item>
|
||||
<item name="android:toolbarStyle">@style/ToolbarStyleDark</item>
|
||||
<item name="android:windowLightStatusBar" tools:targetApi="m">false</item>
|
||||
<item name="android:dialogTheme">@style/DialogThemeLight</item>
|
||||
<item name="android:alertDialogTheme">@style/DialogThemeLight</item>
|
||||
<item name="android:toolbarStyle">@style/ToolbarStyleDark</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNighBlue.Red" parent="ThemeMidNighBlue.Base">
|
||||
<item name="colorAccent">@color/material_red_accent_700</item>
|
||||
<item name="android:alertDialogTheme">@style/DialogThemeMidNighBlue.Red</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNightBlue.Base.Red" parent="ThemeMidNightBlue.Base">
|
||||
<style name="ThemeMidNighBlue.Pink" parent="ThemeMidNighBlue.Base">
|
||||
<item name="colorAccent">@color/material_pink_accent_700</item>
|
||||
<item name="android:alertDialogTheme">@style/DialogThemeMidNighBlue.Pink</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNighBlue.Purple" parent="ThemeMidNighBlue.Base">
|
||||
<item name="colorAccent">@color/material_purple_accent_700</item>
|
||||
<item name="android:alertDialogTheme">@style/DialogThemeMidNighBlue.Purple</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNighBlue.DeepPurple" parent="ThemeMidNighBlue.Base">
|
||||
<item name="colorAccent">@color/material_deep_purple_accent_700</item>
|
||||
<item name="android:alertDialogTheme">@style/DialogThemeMidNighBlue.DeepPurple</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNighBlue.Indigo" parent="ThemeMidNighBlue.Base">
|
||||
<item name="colorAccent">@color/material_indigo_accent_700</item>
|
||||
<item name="android:alertDialogTheme">@style/DialogThemeMidNighBlue.Indigo</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNighBlue.LightBlue" parent="ThemeMidNighBlue.Base">
|
||||
<item name="colorAccent">@color/material_light_blue_accent_700</item>
|
||||
<item name="android:alertDialogTheme">@style/DialogThemeMidNighBlue.LightBlue</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNighBlue.Cyan" parent="ThemeMidNighBlue.Base">
|
||||
<item name="colorAccent">@color/material_cyan_accent_700</item>
|
||||
<item name="android:alertDialogTheme">@style/DialogThemeMidNighBlue.Cyan</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNighBlue.Teal" parent="ThemeMidNighBlue.Base">
|
||||
<item name="colorAccent">@color/material_teal_700</item>
|
||||
<item name="android:alertDialogTheme">@style/DialogThemeMidNighBlue.Teal</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNighBlue.Green" parent="ThemeMidNighBlue.Base">
|
||||
<item name="colorAccent">@color/material_green_accent_700</item>
|
||||
<item name="android:alertDialogTheme">@style/DialogThemeMidNighBlue.Green</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNighBlue.LightGreen" parent="ThemeMidNighBlue.Base">
|
||||
<item name="colorAccent">@color/material_light_green_accent_700</item>
|
||||
<item name="android:alertDialogTheme">@style/DialogThemeMidNighBlue.LightGreen</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNighBlue.Lime" parent="ThemeMidNighBlue.Base">
|
||||
<item name="colorAccent">@color/material_lime_accent_700</item>
|
||||
<item name="android:alertDialogTheme">@style/DialogThemeMidNighBlue.Lime</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNighBlue.Yellow" parent="ThemeMidNighBlue.Base">
|
||||
<item name="colorAccent">@color/material_yellow_accent_700</item>
|
||||
<item name="android:alertDialogTheme">@style/DialogThemeMidNighBlue.Yellow</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNighBlue.Amber" parent="ThemeMidNighBlue.Base">
|
||||
<item name="colorAccent">@color/material_amber_accent_700</item>
|
||||
<item name="android:alertDialogTheme">@style/DialogThemeMidNighBlue.Amber</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNighBlue.Orange" parent="ThemeMidNighBlue.Base">
|
||||
<item name="colorAccent">@color/material_orange_accent_700</item>
|
||||
<item name="android:alertDialogTheme">@style/DialogThemeMidNighBlue.Orange</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNighBlue.DeepOrange" parent="ThemeMidNighBlue.Base">
|
||||
<item name="colorAccent">@color/material_deep_orange_accent_700</item>
|
||||
<item name="android:alertDialogTheme">@style/DialogThemeMidNighBlue.DeepOrange</item>
|
||||
</style>
|
||||
|
||||
<style name="PopupThemeMidNighBlue" parent="ThemeOverlay.AppCompat">
|
||||
<item name="android:colorBackground">@color/midnightBlueWindowBackground</item>
|
||||
</style>
|
||||
|
||||
<style name="DialogThemeMidNighBlue" parent="Theme.AppCompat.Dialog.Alert">
|
||||
<item name="colorPrimary">#213040</item>
|
||||
<item name="colorPrimaryDark">#101B27</item>
|
||||
<item name="colorAccent">#4C5B6A</item>
|
||||
<item name="android:windowBackground">@color/midnightBlueWindowBackground</item>
|
||||
</style>
|
||||
|
||||
<style name="DialogThemeMidNighBlue.Red" parent="DialogThemeMidNighBlue">
|
||||
<item name="colorAccent">@color/material_red_accent_700</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNightBlue.Base.Pink" parent="ThemeMidNightBlue.Base">
|
||||
<style name="DialogThemeMidNighBlue.Pink" parent="DialogThemeMidNighBlue">
|
||||
<item name="colorAccent">@color/material_pink_accent_700</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNightBlue.Base.Purple" parent="ThemeMidNightBlue.Base">
|
||||
<style name="DialogThemeMidNighBlue.Purple" parent="DialogThemeMidNighBlue">
|
||||
<item name="colorAccent">@color/material_purple_accent_700</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNightBlue.Base.DeepPurple" parent="ThemeMidNightBlue.Base">
|
||||
<style name="DialogThemeMidNighBlue.DeepPurple" parent="DialogThemeMidNighBlue">
|
||||
<item name="colorAccent">@color/material_deep_purple_accent_700</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNightBlue.Base.Indigo" parent="ThemeMidNightBlue.Base">
|
||||
<style name="DialogThemeMidNighBlue.Indigo" parent="DialogThemeMidNighBlue">
|
||||
<item name="colorAccent">@color/material_indigo_accent_700</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNightBlue.Base.LightBlue" parent="ThemeMidNightBlue.Base">
|
||||
<style name="DialogThemeMidNighBlue.LightBlue" parent="DialogThemeMidNighBlue">
|
||||
<item name="colorAccent">@color/material_light_blue_accent_700</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNightBlue.Base.Cyan" parent="ThemeMidNightBlue.Base">
|
||||
<style name="DialogThemeMidNighBlue.Cyan" parent="DialogThemeMidNighBlue">
|
||||
<item name="colorAccent">@color/material_cyan_accent_700</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNightBlue.Base.Teal" parent="ThemeMidNightBlue.Base">
|
||||
<style name="DialogThemeMidNighBlue.Teal" parent="DialogThemeMidNighBlue">
|
||||
<item name="colorAccent">@color/material_teal_accent_700</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNightBlue.Base.Green" parent="ThemeMidNightBlue.Base">
|
||||
<style name="DialogThemeMidNighBlue.Green" parent="DialogThemeMidNighBlue">
|
||||
<item name="colorAccent">@color/material_green_accent_700</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNightBlue.Base.LightGreen" parent="ThemeMidNightBlue.Base">
|
||||
<style name="DialogThemeMidNighBlue.LightGreen" parent="DialogThemeMidNighBlue">
|
||||
<item name="colorAccent">@color/material_light_green_accent_700</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNightBlue.Base.Lime" parent="ThemeMidNightBlue.Base">
|
||||
<style name="DialogThemeMidNighBlue.Lime" parent="DialogThemeMidNighBlue">
|
||||
<item name="colorAccent">@color/material_lime_accent_700</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNightBlue.Base.Yellow" parent="ThemeMidNightBlue.Base">
|
||||
<style name="DialogThemeMidNighBlue.Yellow" parent="DialogThemeMidNighBlue">
|
||||
<item name="colorAccent">@color/material_yellow_accent_700</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNightBlue.Base.Amber" parent="ThemeMidNightBlue.Base">
|
||||
<style name="DialogThemeMidNighBlue.Amber" parent="DialogThemeMidNighBlue">
|
||||
<item name="colorAccent">@color/material_amber_accent_700</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNightBlue.Base.Orange" parent="ThemeMidNightBlue.Base">
|
||||
<style name="DialogThemeMidNighBlue.Orange" parent="DialogThemeMidNighBlue">
|
||||
<item name="colorAccent">@color/material_orange_accent_700</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeMidNightBlue.Base.DeepOrange" parent="ThemeMidNightBlue.Base">
|
||||
<style name="DialogThemeMidNighBlue.DeepOrange" parent="DialogThemeMidNighBlue">
|
||||
<item name="colorAccent">@color/material_deep_orange_accent_700</item>
|
||||
</style>
|
||||
|
||||
<style name="TimeLineBackgroundMidNightBlue">
|
||||
<item name="android:background">@drawable/ic_timeline_arrow_left</item>
|
||||
<item name="android:backgroundTint">#213040</item>
|
||||
</style>
|
||||
|
||||
<style name="DialogThemeMidNight" parent="@style/Theme.AppCompat.Dialog">
|
||||
<item name="android:windowMinWidthMajor">@android:dimen/dialog_min_width_major</item>
|
||||
<item name="android:windowMinWidthMinor">@android:dimen/dialog_min_width_minor</item>
|
||||
<item name="android:windowBackground">@color/midNightBlueWindowBackground</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.AboutActivity.MidNight" parent="ThemeMidNightBlue">
|
||||
<style name="AppTheme.AboutActivity.MidNightBlue" parent="ThemeMidNighBlue">
|
||||
<item name="mal_popupOverlay">@style/Theme.Mal.Dark.PopupOverlay</item>
|
||||
<item name="colorPrimary">#213040</item>
|
||||
<item name="colorPrimaryDark">#4C5B6A</item>
|
||||
<item name="colorAccent">#2196F3</item>
|
||||
<item name="colorPrimaryDark">#101B27</item>
|
||||
<item name="colorAccent">#4C5B6A</item>
|
||||
<item name="mal_lightActionBar">false</item>
|
||||
<item name="mal_color_primary">#eee</item>
|
||||
<item name="mal_color_secondary">#ffe0e0e0</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@ -16,7 +16,7 @@
|
||||
android:title="@string/enable_signature_box"/>
|
||||
|
||||
<SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:defaultValue="false"
|
||||
android:key="sent_via"
|
||||
android:icon="@drawable/ic_edit"
|
||||
android:summary="@string/enable_signature_summary"
|
||||
|
||||
@ -7,11 +7,9 @@
|
||||
android:key="enable_ads"
|
||||
android:title="@string/enable_ads"/>
|
||||
|
||||
<ListPreference
|
||||
<com.fastaccess.ui.widgets.ColorPickerPreference
|
||||
android:defaultValue="@string/blue_theme_mode"
|
||||
android:dialogTitle="@string/theme_color_title"
|
||||
android:entries="@array/theme_colors"
|
||||
android:entryValues="@array/theme_colors"
|
||||
android:key="appColor"
|
||||
android:icon="@drawable/ic_color_lens"
|
||||
android:summary="@string/theme_color_summary"
|
||||
|
||||
@ -5,7 +5,7 @@ buildscript {
|
||||
butterKnifeVersion = '8.5.1'
|
||||
state_version = '1.0.6'
|
||||
lombokVersion = '1.12.6'
|
||||
supportVersion = "26.0.0-beta2"
|
||||
supportVersion = "25.3.1"
|
||||
gms = "11.0.0"
|
||||
thirtyinchVersion = '0.8.0'
|
||||
retrofit = '2.3.0'
|
||||
|
||||
@ -6,4 +6,4 @@ github_client_id=GITHUB_CLIENT_ID
|
||||
github_secret=GITHUB_SECRET
|
||||
imgur_client_id=imgur_client_id
|
||||
imgur_secret=imgur_secret
|
||||
redirect_url=fasthub://login
|
||||
redirect_url=fasthub://login
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user