Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/app.iml
  • Loading branch information
zzq committed Apr 5, 2019
2 parents bb11de0 + 8d7c7c8 commit 484276d
Show file tree
Hide file tree
Showing 16 changed files with 272 additions and 192 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ An unofficial bilibili client for android

## Remark

#### java版地址:[bilibili](https://github.com/yoyiyi/bilisoleil)
#### java版地址:[bilisoleil](https://github.com/yoyiyi/bilisoleil)
#### kotlin版地址:[bilisoleil-kotlin](https://github.com/yoyiyi/bilisoleil-kotlin)

b站接口有些加密过,抓不到,有些我直接抓了一个,请求参数啥的,不懂啥意思,直接用了,有些接口直接用原项目[bilibili-android-client](https://github.com/HotBitmapGG/bilibili-android-client)
Expand Down
Binary file removed app-debug.apk
Binary file not shown.
210 changes: 109 additions & 101 deletions app/app.iml

Large diffs are not rendered by default.

125 changes: 57 additions & 68 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
//2.3使用
buildscript {
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'me.tatarka:gradle-retrolambda:3.2.5'
}
}

apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'//2.3使用

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.yoyiyi.soleil"
minSdkVersion 17
targetSdkVersion 25
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -39,81 +28,81 @@ android {
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
//stream
compile 'com.annimon:stream:1.1.6'
implementation 'com.annimon:stream:1.1.6'
//流布局
//compile 'com.zhy:flowlayout-lib:1.0.3'
//rxjava2
compile 'io.reactivex.rxjava2:rxjava:2.0.8'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxjava:2.0.8'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
//permissions
compile 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.4@aar'
implementation 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.4@aar'
//butterknife
compile 'com.jakewharton:butterknife:8.5.1'
implementation 'com.jakewharton:butterknife:8.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
//dagger2
compile 'com.google.dagger:dagger:2.10'
implementation 'com.google.dagger:dagger:2.10'
annotationProcessor 'com.google.dagger:dagger-compiler:2.10'
//glide
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'jp.wasabeef:glide-transformations:2.0.2'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'jp.wasabeef:glide-transformations:2.0.2'
//network
compile 'com.squareup.okhttp3:okhttp:3.7.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.7.0'
compile 'com.squareup.retrofit2:retrofit:2.2.0'
compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
compile 'com.squareup.retrofit2:converter-gson:2.2.0'
implementation 'com.squareup.okhttp3:okhttp:3.7.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.7.0'
implementation 'com.squareup.retrofit2:retrofit:2.2.0'
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
implementation 'com.squareup.retrofit2:converter-gson:2.2.0'
//rxbinding
compile 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
implementation 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
//rxlifecycle
compile 'com.trello.rxlifecycle2:rxlifecycle:2.0.1'
compile 'com.trello.rxlifecycle2:rxlifecycle-components:2.0.1'
implementation 'com.trello.rxlifecycle2:rxlifecycle:2.0.1'
implementation 'com.trello.rxlifecycle2:rxlifecycle-components:2.0.1'
//Flycotablayout
compile 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'
compile 'com.github.hymanme.tagflowlayout:tagflowlayout:0.2.2'
implementation 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'
implementation 'com.github.hymanme.tagflowlayout:tagflowlayout:0.2.2'
//轮播条
compile 'com.youth.banner:banner:1.4.9'
implementation 'com.youth.banner:banner:1.4.9'
//搜索框
compile 'com.miguelcatalan:materialsearchview:1.4.0'
implementation 'com.miguelcatalan:materialsearchview:1.4.0'
//BaseRecyclerViewAdapterHelper
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.16'
compile 'com.miguelcatalan:materialsearchview:1.4.0'
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.16'
implementation 'com.miguelcatalan:materialsearchview:1.4.0'
//ijk
compile 'tv.danmaku.ijk.media:ijkplayer-java:0.8.0'
compile 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.0'
compile 'tv.danmaku.ijk.media:ijkplayer-armv5:0.8.0'
compile 'tv.danmaku.ijk.media:ijkplayer-x86:0.8.0'
implementation 'tv.danmaku.ijk.media:ijkplayer-java:0.8.0'
implementation 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.0'
implementation 'tv.danmaku.ijk.media:ijkplayer-armv5:0.8.0'
implementation 'tv.danmaku.ijk.media:ijkplayer-x86:0.8.0'
//烈焰弹幕使
compile 'com.github.ctiao:DanmakuFlameMaster:0.5.6'
implementation 'com.github.ctiao:DanmakuFlameMaster:0.5.6'
//compile 'com.github.ctiao:ndkbitmap-armv7a:0.5.9'
//调试工具
compile 'com.facebook.stetho:stetho:1.4.2'
compile 'com.facebook.stetho:stetho-okhttp3:1.4.2'
compile 'com.orhanobut:logger:1.15'
compile files('libs/ShareSDK-Wechat-Moments-2.8.3.jar')
compile files('libs/ShareSDK-Wechat-Favorite-2.8.3.jar')
compile files('libs/ShareSDK-Wechat-Core-2.8.3.jar')
compile files('libs/ShareSDK-Wechat-2.8.3.jar')
compile files('libs/ShareSDK-Twitter-2.8.3.jar')
compile files('libs/ShareSDK-TencentWeibo-2.8.3.jar')
compile files('libs/ShareSDK-SinaWeibo-2.8.3.jar')
compile files('libs/ShareSDK-ShortMessage-2.8.3.jar')
compile files('libs/ShareSDK-QZone-2.8.3.jar')
compile files('libs/ShareSDK-QQ-2.8.3.jar')
compile files('libs/ShareSDK-Facebook-2.8.3.jar')
compile files('libs/ShareSDK-Email-2.8.3.jar')
compile files('libs/ShareSDK-Core-2.8.3.jar')
compile files('libs/MobTools-2017.0412.1554.jar')
compile files('libs/MobCommons-2017.0412.1554.jar')
compile 'org.jsoup:jsoup:1.10.3'
implementation 'com.facebook.stetho:stetho:1.4.2'
implementation 'com.facebook.stetho:stetho-okhttp3:1.4.2'
implementation 'com.orhanobut:logger:1.15'
implementation files('libs/ShareSDK-Wechat-Moments-2.8.3.jar')
implementation files('libs/ShareSDK-Wechat-Favorite-2.8.3.jar')
implementation files('libs/ShareSDK-Wechat-Core-2.8.3.jar')
implementation files('libs/ShareSDK-Wechat-2.8.3.jar')
implementation files('libs/ShareSDK-Twitter-2.8.3.jar')
implementation files('libs/ShareSDK-TencentWeibo-2.8.3.jar')
implementation files('libs/ShareSDK-SinaWeibo-2.8.3.jar')
implementation files('libs/ShareSDK-ShortMessage-2.8.3.jar')
implementation files('libs/ShareSDK-QZone-2.8.3.jar')
implementation files('libs/ShareSDK-QQ-2.8.3.jar')
implementation files('libs/ShareSDK-Facebook-2.8.3.jar')
implementation files('libs/ShareSDK-Email-2.8.3.jar')
implementation files('libs/ShareSDK-Core-2.8.3.jar')
implementation files('libs/MobTools-2017.0412.1554.jar')
implementation files('libs/MobCommons-2017.0412.1554.jar')
implementation 'org.jsoup:jsoup:1.10.3'
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import com.annimon.stream.Stream;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;
import java.util.ArrayList;

import static org.junit.Assert.assertEquals;

/**
* Instrumentation test, which will execute on an Android device.
Expand All @@ -23,4 +27,16 @@ public void useAppContext() throws Exception {

assertEquals("com.yoyiyi.soleil", appContext.getPackageName());
}

@Test
public void user() throws Exception {
ArrayList<Integer> list = new ArrayList<>();
list.add(1);
list.add(1);
list.add(2);
list.add(2);
System.out.print(2222);
Stream.of(list).distinct().forEach(System.out::println);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ public LiveBannerSection(List<LivePartition.BannerBean> list) {

@Override
public void onBindHeaderViewHolder(ViewHolder holder) {
Banner bannar = holder.getView(R.id.banner);
Banner banner = holder.getView(R.id.banner);
List<String> urls = Stream.of(mList).map(bannerBean -> bannerBean.img).collect(Collectors.toList());
bannar.setIndicatorGravity(BannerConfig.RIGHT)
banner.setIndicatorGravity(BannerConfig.RIGHT)
.setImages(urls)
.setImageLoader(new GlideImageLoader())
.start();
bannar.setOnBannerListener(i -> {
banner.setOnBannerListener(i -> {
LivePartition.BannerBean bannerBean = mList.get(i);
BrowerActivity.startActivity(mContext,bannerBean.link,bannerBean.title,bannerBean.img);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public void onBindHeaderViewHolder(ViewHolder holder) {
.placeholder(R.drawable.bili_default_image_tv)
.dontAnimate()
.into((ImageView) holder.getView(R.id.iv_video_preview));
holder.setText(R.id.tv_video_live_up, TextUtils.isEmpty(mData.owner.name) ? "未知" : mData.owner.name)//up
// holder.setText(R.id.tv_video_live_up, TextUtils.isEmpty(mData.owner.name) ? "未知" : mData.owner.name)//up
holder.setText(R.id.tv_video_live_up, TextUtils.isEmpty(mData.title) ? "未知" : mData.title)
.setText(R.id.tv_video_online, mData.online + "");//在线人数;
holder.setText(R.id.tv_video_title, new SpanUtils()
.append("#" + mData.area + "#")
Expand Down
35 changes: 27 additions & 8 deletions app/src/main/java/com/yoyiyi/soleil/base/BaseActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@
import com.yoyiyi.soleil.di.component.ActivityComponent;
import com.yoyiyi.soleil.di.component.DaggerActivityComponent;
import com.yoyiyi.soleil.di.module.ActivityModule;
import com.yoyiyi.soleil.event.Event;
import com.yoyiyi.soleil.rx.RxBus;
import com.yoyiyi.soleil.utils.AppUtils;
import com.yoyiyi.soleil.widget.statusbar.StatusBarUtil;

import javax.inject.Inject;

import butterknife.ButterKnife;
import io.reactivex.disposables.Disposable;


/**
Expand All @@ -36,6 +39,7 @@ public abstract class BaseActivity<T extends BaseContract.BasePresenter> extends
// protected DrawerLayout mDrawerLayout;
protected boolean mBack = true;
private ConstraintLayout mError;
private Disposable mDisposable;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -60,6 +64,7 @@ protected void onCreate(Bundle savedInstanceState) {
}
initWidget();
initDatas();
initExit();
}


Expand All @@ -74,6 +79,20 @@ protected ActivityComponent getActivityComponent() {
.build();
}


/**
* 退出应用
*/
private void initExit() {
mDisposable = RxBus.INSTANCE.toDefaultFlowable(Event.ExitEvent.class, exitEvent -> {
if (exitEvent.exit == -1) {
finish();
}
});


}

/**
* 注入依赖
*/
Expand Down Expand Up @@ -104,9 +123,9 @@ protected void initStatusBar() {

@Override
protected void onSaveInstanceState(Bundle outState) {
//如果用以下这种做法则不保存状态,再次进来的话会显示默认tab
//总是执行这句代码来调用父类去保存视图层的状态
//super.onSaveInstanceState(outState);
//如果用以下这种做法则不保存状态,再次进来的话会显示默认tab
//总是执行这句代码来调用父类去保存视图层的状态
//super.onSaveInstanceState(outState);
}

/**
Expand Down Expand Up @@ -141,6 +160,9 @@ protected void onDestroy() {
if (mPresenter != null) mPresenter.detachView();
BiliSoleilApplication.getInstance().removeActivity(this);
super.onDestroy();
if (!mDisposable.isDisposed()) {
mDisposable.dispose();
}
}

/**
Expand Down Expand Up @@ -247,10 +269,7 @@ protected void visible(final @IdRes int... id) {

private View $(@IdRes int id) {
View view;
if (this != null) {
view = this.findViewById(id);
return view;
}
return null;
view = this.findViewById(id);
return view;
}
}
1 change: 1 addition & 0 deletions app/src/main/java/com/yoyiyi/soleil/base/BaseFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ protected FragmentModule getFragmentModule() {
*/
protected void initRecyclerView() {


}

/**
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/com/yoyiyi/soleil/event/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ public static class RegionEntrancePositionEvent {
public int position;
}

public static class ExitEvent {
public int exit;
}

public static class AllStationPositionEvent {
public int position;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import android.view.KeyEvent;
import android.view.MenuItem;

import com.yoyiyi.soleil.BiliSoleilApplication;
import com.yoyiyi.soleil.R;
import com.yoyiyi.soleil.base.BaseActivity;
import com.yoyiyi.soleil.constant.Constants;
Expand Down Expand Up @@ -116,7 +115,10 @@ private void exitApp() {
ToastUtils.showToast("再按一次退出");
exitTime = System.currentTimeMillis();
} else {
BiliSoleilApplication.getInstance().exitApp();
// BiliSoleilApplication.getInstance().exitApp();
Event.ExitEvent event = new Event.ExitEvent();
event.exit = -1;
RxBus.INSTANCE.post(event);
}
}

Expand Down
Loading

0 comments on commit 484276d

Please sign in to comment.