|
|
|
|
@ -14,6 +14,8 @@ import android.view.KeyEvent; |
|
|
|
|
import android.view.View; |
|
|
|
|
import android.view.ViewGroup; |
|
|
|
|
import android.view.animation.AccelerateInterpolator; |
|
|
|
|
import android.view.animation.AlphaAnimation; |
|
|
|
|
import android.view.animation.Animation; |
|
|
|
|
import android.view.animation.BounceInterpolator; |
|
|
|
|
import android.widget.LinearLayout; |
|
|
|
|
import android.widget.TextView; |
|
|
|
|
@ -287,6 +289,9 @@ public class HomeActivity extends BaseActivity { |
|
|
|
|
sortAdapter.setNewData(DefaultConfig.adjustSort(ApiConfig.get().getHomeSourceBean().getKey(), new ArrayList<>(), true)); |
|
|
|
|
} |
|
|
|
|
initViewPager(absXml); |
|
|
|
|
SourceBean home = ApiConfig.get().getHomeSourceBean(); |
|
|
|
|
if (home != null && home.getName() != null && !home.getName().isEmpty()) tvName.setText(home.getName()); |
|
|
|
|
tvName.clearAnimation(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
@ -295,9 +300,6 @@ public class HomeActivity extends BaseActivity { |
|
|
|
|
private boolean jarInitOk = false; |
|
|
|
|
|
|
|
|
|
private void initData() { |
|
|
|
|
SourceBean home = ApiConfig.get().getHomeSourceBean(); |
|
|
|
|
if (home != null && home.getName() != null && !home.getName().isEmpty()) |
|
|
|
|
tvName.setText(home.getName()); |
|
|
|
|
if (dataInitOk && jarInitOk) { |
|
|
|
|
sourceViewModel.getSort(ApiConfig.get().getHomeSourceBean().getKey()); |
|
|
|
|
if (hasPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)) { |
|
|
|
|
@ -310,6 +312,7 @@ public class HomeActivity extends BaseActivity { |
|
|
|
|
} |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
tvNameAnimation(); |
|
|
|
|
showLoading(); |
|
|
|
|
if (dataInitOk && !jarInitOk) { |
|
|
|
|
if (!ApiConfig.get().getSpider().isEmpty()) { |
|
|
|
|
@ -726,5 +729,16 @@ public class HomeActivity extends BaseActivity { |
|
|
|
|
showSuccess(); |
|
|
|
|
sortAdapter.setNewData(DefaultConfig.adjustSort(ApiConfig.get().getHomeSourceBean().getKey(), new ArrayList<>(), true)); |
|
|
|
|
initViewPager(null); |
|
|
|
|
tvName.clearAnimation(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void tvNameAnimation() |
|
|
|
|
{ |
|
|
|
|
AlphaAnimation blinkAnimation = new AlphaAnimation(0.0f, 1.0f); |
|
|
|
|
blinkAnimation.setDuration(500); |
|
|
|
|
blinkAnimation.setStartOffset(20); |
|
|
|
|
blinkAnimation.setRepeatMode(Animation.REVERSE); |
|
|
|
|
blinkAnimation.setRepeatCount(Animation.INFINITE); |
|
|
|
|
tvName.startAnimation(blinkAnimation); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|