Skip to content

Commit

Permalink
release 1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Zweihui committed Jan 19, 2018
1 parent c78d87e commit 99ec7d0
Show file tree
Hide file tree
Showing 19 changed files with 164 additions and 167 deletions.
14 changes: 7 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ android {
}
}
productFlavors {
baidu {

manifestPlaceholders = [BUGLY_APP_CHANNEL_VALUE:"baidu"]

}
// baidu {
//
// manifestPlaceholders = [BUGLY_APP_CHANNEL_VALUE:"baidu"]
//
// }
fir {

manifestPlaceholders = [BUGLY_APP_CHANNEL_VALUE:"fir"]
Expand All @@ -98,8 +98,8 @@ android {
if (variant.buildType.name.equals('release')) {
//生成apk名字的格式:Channel1.0.0_2016-06-22_baidu.apk
//可自定义自己想要生成的格式
def fileName = "Channel${defaultConfig.versionName}_${releaseTime()}_${variant.productFlavors[0].name}.apk"
outputFileName = new File(outputFile.parent, fileName)
outputFileName = "Channel${defaultConfig.versionName}_${releaseTime()}_${variant.productFlavors[0].name}.apk"
// outputFileName = new File(outputFile.parent, fileName)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.util.List;
import java.util.concurrent.TimeUnit;

import cn.bmob.v3.Bmob;
import me.jessyan.progressmanager.ProgressManager;
import okhttp3.Interceptor;
import okhttp3.Request;
Expand Down Expand Up @@ -179,6 +180,7 @@ public void onCreate(Application application) {
FileDownloader.setupOnApplicationOnCreate(application);
Beta.upgradeDialogLayoutId = R.layout.view_update_dialog;
Bugly.init(application, Constants.BUGLY_APP_ID, BuildConfig.DEBUG);
Bmob.initialize(application, Constants.BMOB_APP_ID);
// UUIDS.buidleID(application).check();
// CrashReport.initCrashReport(application, Constants.BUGLY_APP_ID, false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,7 @@ public class Constants {
public static final int VIDEOCOLLECTIONWITHBRIEF = 4;
public static final int DYNAMICINFOCARD = 5;

//==================Cache============//
public static final String CACHE_FOLLOWED_INFO = "cache_followed_info";

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.zwh.mvparms.eyepetizer.app.utils;

import android.content.Context;

import com.jess.arms.integration.cache.Cache;
import com.jess.arms.utils.ArmsUtils;
import com.zwh.mvparms.eyepetizer.app.constants.Constants;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.MyAttentionEntity;

import java.util.List;

/**
* Created by Administrator on 2018\1\18 0018.
*/

public class CommonUtils {

public static boolean checkFollowed(Context context,int id) {
List<MyAttentionEntity> list = getFollowedInfo(context);
if (list == null)
return false;
for (MyAttentionEntity entity :list){
if (entity.getId() == id){
return true;
}
}
return false;
}
public static List<MyAttentionEntity> getFollowedInfo(Context context) {
Cache cache = ArmsUtils.obtainAppComponentFromContext(context).extras();
List<MyAttentionEntity> list = (List<MyAttentionEntity>) cache.get(Constants.CACHE_FOLLOWED_INFO);
return list;
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void onNext(AuthorIndexInfo info) {
});
}
public void getAuthorDynamicList(int id, int startCount, boolean isLoadMore) {
mModel.getAuthorDynamicList(id,startCount).compose(RxUtils.applySchedulersWithLifeCycle(mRootView))
mModel.getAuthorDynamicList(id,startCount).compose(RxUtils.applySchedulers(mRootView,isLoadMore))
.subscribe(new ErrorHandleSubscriber<AuthorDynamicInfo>(mErrorHandler) {
@Override
public void onNext(AuthorDynamicInfo info) {
Expand All @@ -85,7 +85,7 @@ public void onNext(AuthorDynamicInfo info) {
});
}
public void getAuthorAlbumList(int id, int startCount, boolean isLoadMore) {
mModel.getAuthorAlbumList(id,startCount).compose(RxUtils.applySchedulersWithLifeCycle(mRootView))
mModel.getAuthorAlbumList(id,startCount).compose(RxUtils.applySchedulers(mRootView,isLoadMore))
.subscribe(new ErrorHandleSubscriber<AuthorAlbumInfo>(mErrorHandler) {
@Override
public void onNext(AuthorAlbumInfo info) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.zwh.mvparms.eyepetizer.R;
import com.zwh.mvparms.eyepetizer.app.EventBusTags;
import com.zwh.mvparms.eyepetizer.app.constants.Constants;
import com.zwh.mvparms.eyepetizer.app.utils.CommonUtils;
import com.zwh.mvparms.eyepetizer.app.utils.helper.AuthorFragmentAdapter;
import com.zwh.mvparms.eyepetizer.di.component.DaggerAuthorDetailComponent;
import com.zwh.mvparms.eyepetizer.di.module.AuthorDetailModule;
Expand All @@ -30,7 +31,6 @@
import com.zwh.mvparms.eyepetizer.mvp.model.entity.AuthorTabsInfo;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.Category;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.MyAttentionEntity;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.MyFollowedInfo;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.ShareInfo;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.VideoListInfo;
import com.zwh.mvparms.eyepetizer.mvp.presenter.AuthorDetailPresenter;
Expand Down Expand Up @@ -157,13 +157,13 @@ private void gotoShare() {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_author_detail, menu);
menu.getItem(2).setTitle(MyFollowedInfo.getInstance().checkFollowed(authorId) ? "取消关注" : "关注");
menu.getItem(2).setTitle(CommonUtils.checkFollowed(this,authorId) ? "取消关注" : "关注");
return true;
}

@Override
public boolean onPrepareOptionsMenu(Menu menu) {
menu.getItem(2).setTitle(MyFollowedInfo.getInstance().checkFollowed(authorId) ? "取消关注" : "关注");
menu.getItem(2).setTitle(CommonUtils.checkFollowed(this,authorId) ? "取消关注" : "关注");
return super.onPrepareOptionsMenu(menu);
}

Expand Down Expand Up @@ -265,9 +265,10 @@ public void done(BmobException e) {
return;
}
UiUtils.makeText(AuthorDetailActivity.this, "已取消关注");
for (int i = 0; i < MyFollowedInfo.getInstance().getList().size(); i++) {
if (MyFollowedInfo.getInstance().getList().get(i).getId() == attention.getId()) {
MyFollowedInfo.getInstance().getList().remove(i);
List<MyAttentionEntity> list = CommonUtils.getFollowedInfo(AuthorDetailActivity.this);
for (int i = 0; i < list.size(); i++) {
if (list.get(i).getId() == attention.getId()) {
list.remove(i);
}
}
}
Expand All @@ -286,7 +287,8 @@ public void done(String s, BmobException e) {
return;
}
UiUtils.makeText(AuthorDetailActivity.this, "已关注");
MyFollowedInfo.getInstance().getList().add(attention);
List<MyAttentionEntity> list = CommonUtils.getFollowedInfo(AuthorDetailActivity.this);
list.add(attention);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import com.jess.arms.http.imageloader.glide.ImageConfigImpl;
import com.jess.arms.utils.PermissionUtil;
import com.jess.arms.utils.UiUtils;
import com.shuyu.gsyvideoplayer.GSYVideoManager;
import com.shuyu.gsyvideoplayer.model.VideoOptionModel;
import com.tbruyelle.rxpermissions2.RxPermissions;
import com.zhihu.matisse.Matisse;
import com.zhihu.matisse.ui.MatisseActivity;
Expand All @@ -41,7 +43,6 @@
import com.zwh.mvparms.eyepetizer.app.constants.Constants;
import com.zwh.mvparms.eyepetizer.app.utils.helper.MainFragmentAdapter;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.MyAttentionEntity;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.MyFollowedInfo;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.User;
import com.zwh.mvparms.eyepetizer.mvp.ui.widget.BottomNavigationViewHelper;
import com.zwh.mvparms.eyepetizer.mvp.ui.widget.CircleImageView;
Expand All @@ -56,12 +57,12 @@
import java.util.List;

import butterknife.BindView;
import cn.bmob.v3.Bmob;
import cn.bmob.v3.BmobQuery;
import cn.bmob.v3.BmobUser;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.FindListener;
import me.jessyan.rxerrorhandler.core.RxErrorHandler;
import tv.danmaku.ijk.media.player.IjkMediaPlayer;

import static com.zwh.mvparms.eyepetizer.R.id.toolbar;
import static com.zwh.mvparms.eyepetizer.mvp.ui.fragment.MineFragment.REQUEST_CODE_CHOOSE;
Expand Down Expand Up @@ -126,11 +127,11 @@ public int initView(Bundle savedInstanceState) {

@Override
public void initData(Bundle savedInstanceState) {
// if (supportsTransitions()){
// Transition transition = TransitionInflater.from(this).inflateTransition(R.transition.trans_activity_slide);
// getWindow().setEnterTransition(transition);
// }
Bmob.initialize(this, Constants.BMOB_APP_ID);
//初始化视频播放器缓冲大小2M
VideoOptionModel videoOptionModel = new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "max-buffer-size", 1024*1024*2);
List<VideoOptionModel> list1 = new ArrayList<>();
list1.add(videoOptionModel);
GSYVideoManager.instance().setOptionModelList(list1);
initFragment();
BottomNavigationViewHelper.disableShiftMode(bottomNavigation);
setSupportActionBar(mToolbar);
Expand Down Expand Up @@ -432,7 +433,7 @@ public void setUserInfo(User user) {
query.findObjects(new FindListener<MyAttentionEntity>() {
@Override
public void done(List<MyAttentionEntity> list, BmobException e) {
MyFollowedInfo.getInstance().setList(list);
appComponent.extras().put(Constants.CACHE_FOLLOWED_INFO,list);
}
});

Expand All @@ -443,7 +444,7 @@ public void logoutReset(String tag) {
TextView name = (TextView) mNvMainNavigation.getHeaderView(0).findViewById(R.id.tv_name);
name.setText("点击头像登录");
img.setImageDrawable(getResources().getDrawable(R.drawable.ic_noface));
MyFollowedInfo.getInstance().setList(null);
appComponent.extras().remove(Constants.CACHE_FOLLOWED_INFO);
}

@Subscriber(tag = EventBusTags.MAIN_ACTIVITY_PERMISSION)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import android.widget.TextView;

import com.apt.TRouter;
import com.bumptech.glide.load.resource.bitmap.FitCenter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.google.gson.Gson;
import com.jess.arms.di.component.AppComponent;
Expand Down Expand Up @@ -434,7 +433,7 @@ private void initMedia() {
List<SwitchVideoModel> list = new ArrayList<>();
list.add(switchVideoModel);
list.add(switchVideoModel2);
detailPlayer.setUp(list, true, "");
detailPlayer.setUp(list, true, videoInfo.getData().getTitle());
} catch (Exception e) {
String source1 = videoInfo.getData().getPlayUrl();
String name = "标清";
Expand All @@ -447,9 +446,6 @@ private void initMedia() {
list.add(switchVideoModel2);
detailPlayer.setUp(list, true,"");
}
//增加封面
mIvVideoBg = new ImageView(this);
mIvVideoBg.setScaleType(ImageView.ScaleType.CENTER_CROP);
resolveNormalVideoUI();

//外部辅助的旋转,帮助全屏
Expand Down Expand Up @@ -640,14 +636,6 @@ private void setVideoInfo() {
list.add(switchVideoModel2);
detailPlayer.setUp(list, true, "");
}
mAppComponent.imageLoader().loadImage(this,
ImageConfigImpl
.builder()
.url(videoInfo.getData().getCover().getFeed())
.imageView(mIvVideoBg)
.transformation(new FitCenter())
.build());
detailPlayer.setThumbImageView(mIvVideoBg);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
import com.zwh.annotation.aspect.SingleClick;
import com.zwh.mvparms.eyepetizer.R;
import com.zwh.mvparms.eyepetizer.app.constants.Constants;
import com.zwh.mvparms.eyepetizer.app.utils.CommonUtils;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.AttentionInfo.ItemListBeanX;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.DataExtra;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.MyAttentionEntity;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.MyFollowedInfo;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.VideoListInfo;
import com.zwh.mvparms.eyepetizer.mvp.ui.widget.FollowButton;

Expand Down Expand Up @@ -58,8 +58,8 @@ protected void convert(BaseViewHolder helper, ItemListBeanX item) {

}
FollowButton button = helper.getView(R.id.btn_attention);
button.setState(MyFollowedInfo.getInstance().
checkFollowed(item.getData().getHeader().getId())?FollowButton.FOLLOWED:FollowButton.UNFOLLOWED);
button.setState(CommonUtils.checkFollowed(context,item.getData().getHeader().getId())
?FollowButton.FOLLOWED:FollowButton.UNFOLLOWED);
MyAttentionEntity attention = new MyAttentionEntity();
attention.setId(item.getData().getHeader().getId());
attention.setTitle((item.getData().getHeader().getTitle()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
import com.zwh.annotation.aspect.SingleClick;
import com.zwh.mvparms.eyepetizer.R;
import com.zwh.mvparms.eyepetizer.app.constants.Constants;
import com.zwh.mvparms.eyepetizer.app.utils.CommonUtils;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.AuthorIndexInfo;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.DataExtra;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.MyAttentionEntity;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.MyFollowedInfo;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.VideoListInfo;
import com.zwh.mvparms.eyepetizer.mvp.ui.widget.FollowButton;
import com.zwh.mvparms.eyepetizer.mvp.ui.widget.MyBanner;
Expand Down Expand Up @@ -122,8 +122,8 @@ protected void convert(BaseViewHolder helper, AuthorIndexInfo.ItemListBeanX item
helper.addOnClickListener(R.id.ctl_author_index_like);
helper.addOnClickListener(R.id.btn_attention);
FollowButton button = helper.getView(R.id.btn_attention);
button.setState(MyFollowedInfo.getInstance().
checkFollowed(item.getData().getHeader().getId())?FollowButton.FOLLOWED:FollowButton.UNFOLLOWED);
button.setState(CommonUtils.checkFollowed(context,item.getData().getHeader().getId())
?FollowButton.FOLLOWED:FollowButton.UNFOLLOWED);
MyAttentionEntity attention = new MyAttentionEntity();
attention.setId(item.getData().getHeader().getId());
attention.setTitle((item.getData().getHeader().getTitle()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.zwh.mvparms.eyepetizer.R;
import com.zwh.mvparms.eyepetizer.app.EventBusTags;
import com.zwh.mvparms.eyepetizer.app.constants.Constants;
import com.zwh.mvparms.eyepetizer.app.utils.CommonUtils;
import com.zwh.mvparms.eyepetizer.di.component.DaggerAuthorDetailIndexComponent;
import com.zwh.mvparms.eyepetizer.di.module.AuthorDetailModule;
import com.zwh.mvparms.eyepetizer.mvp.contract.AuthorDetailContract;
Expand All @@ -32,7 +33,6 @@
import com.zwh.mvparms.eyepetizer.mvp.model.entity.AuthorTabsInfo;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.DataExtra;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.MyAttentionEntity;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.MyFollowedInfo;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.ShareInfo;
import com.zwh.mvparms.eyepetizer.mvp.model.entity.VideoListInfo;
import com.zwh.mvparms.eyepetizer.mvp.presenter.AuthorDetailPresenter;
Expand Down Expand Up @@ -245,7 +245,7 @@ private void initHeadView(AuthorTabsInfo info) {
attention.setDescription((info.getPgcInfo().getDescription()));
attention.setIcon((info.getPgcInfo().getIcon()));
FollowButton button = headView.findViewById(R.id.btn_attention);
button.setState(MyFollowedInfo.getInstance().checkFollowed(id) ? FollowButton.FOLLOWED:FollowButton.UNFOLLOWED);
button.setState(CommonUtils.checkFollowed(headView.getContext(),id) ? FollowButton.FOLLOWED:FollowButton.UNFOLLOWED);
button.setOnFollowClickListener(new FollowButton.onFollowClickListener() {
@Override
public void onFollowed() {
Expand Down
Loading

0 comments on commit 99ec7d0

Please sign in to comment.