mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 03:28:52 +01:00
Fixed welcome screen issues
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
package com.moez.QKSMS.ui.welcome;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.view.View;
|
||||
import com.moez.QKSMS.ui.base.QKFragment;
|
||||
|
||||
public class BaseWelcomeFragment extends QKFragment {
|
||||
|
||||
public interface WelcomeScrollListener {
|
||||
public void onScrollOffsetChanged(WelcomeActivity activity, float offset);
|
||||
void onScrollOffsetChanged(WelcomeActivity activity, float offset);
|
||||
}
|
||||
|
||||
protected static ViewPager mPager;
|
||||
@@ -20,4 +22,8 @@ public class BaseWelcomeFragment extends QKFragment {
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.moez.QKSMS.ui.welcome;
|
||||
|
||||
import android.animation.ArgbEvaluator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.app.Fragment;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.PorterDuff;
|
||||
@@ -9,9 +7,10 @@ import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.view.View;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
import android.widget.ImageView;
|
||||
import com.moez.QKSMS.R;
|
||||
import com.moez.QKSMS.common.LiveViewManager;
|
||||
import com.moez.QKSMS.common.preferences.QKPreference;
|
||||
import com.moez.QKSMS.ui.ThemeManager;
|
||||
import com.moez.QKSMS.ui.base.QKActivity;
|
||||
import com.moez.QKSMS.ui.settings.SettingsFragment;
|
||||
@@ -60,21 +59,10 @@ public class WelcomeActivity extends QKActivity implements ViewPager.OnPageChang
|
||||
BaseWelcomeFragment.setContext(this);
|
||||
mPager.setOnPageChangeListener(this);
|
||||
mPager.setAdapter(new WelcomePagerAdapter(getFragmentManager()));
|
||||
}
|
||||
|
||||
public void setColor(int color) {
|
||||
ValueAnimator colorAnimation = ValueAnimator.ofObject(new ArgbEvaluator(), ThemeManager.getColor(), color);
|
||||
colorAnimation.setDuration(ThemeManager.TRANSITION_LENGTH);
|
||||
colorAnimation.setInterpolator(new DecelerateInterpolator());
|
||||
colorAnimation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
@Override
|
||||
public void onAnimationUpdate(ValueAnimator animation) {
|
||||
mBackground.setBackgroundColor((Integer) animation.getAnimatedValue());
|
||||
}
|
||||
LiveViewManager.registerView(QKPreference.THEME, this, key -> {
|
||||
mBackground.setBackgroundColor(ThemeManager.getColor());
|
||||
});
|
||||
colorAnimation.start();
|
||||
|
||||
ThemeManager.setColor(this, color);
|
||||
}
|
||||
|
||||
public void setColorBackground(int color) {
|
||||
|
||||
@@ -28,7 +28,7 @@ public class WelcomeThemeFragment extends BaseWelcomeFragment implements ColorPi
|
||||
|
||||
@Override
|
||||
public void onColorSelected(int color) {
|
||||
((WelcomeActivity) getActivity()).setColor(color);
|
||||
ThemeManager.setColor(mContext, color);
|
||||
mPallette.drawPalette(ThemeManager.PALETTE, color);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user