version:1.2.0
bugfixes: update:显示可用空间
This commit is contained in:
@@ -16,8 +16,8 @@ android {
|
||||
applicationId "com.uiui.videoplayer"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 28
|
||||
versionCode 119
|
||||
versionName "1.1.9"
|
||||
versionCode 120
|
||||
versionName "1.2.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.uiui.videoplayer.base.mvvm.BaseViewModel;
|
||||
import com.uiui.videoplayer.databinding.ActivityMainBinding;
|
||||
|
||||
public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEvent> {
|
||||
private static final String TAG = "MainViewModel";
|
||||
|
||||
@Override
|
||||
public ActivityMainBinding getVDBinding() {
|
||||
return binding;
|
||||
@@ -16,5 +18,4 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -73,6 +73,8 @@ public class VipActivity extends BaseMvvmActivity<VipViewModel, ActivityVipBindi
|
||||
});
|
||||
mViewModel.getHomeSpaceInfo();
|
||||
|
||||
mViewModel.getActivationInfo();
|
||||
|
||||
}
|
||||
|
||||
public class Click {
|
||||
|
||||
@@ -7,6 +7,7 @@ import androidx.lifecycle.MutableLiveData;
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.uiui.videoplayer.base.mvvm.BaseViewModel;
|
||||
import com.uiui.videoplayer.bean.ActivationInfo;
|
||||
import com.uiui.videoplayer.bean.BaseResponse;
|
||||
import com.uiui.videoplayer.bean.SpaceInfo;
|
||||
import com.uiui.videoplayer.databinding.ActivityVipBinding;
|
||||
@@ -66,4 +67,31 @@ public class VipViewModel extends BaseViewModel<ActivityVipBinding, ActivityEven
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void getActivationInfo() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getActivationControl()
|
||||
.subscribe(new Observer<BaseResponse<ActivationInfo>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<ActivationInfo> baseResponse) {
|
||||
Log.e("getActivationInfo", "onNext: " + baseResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.uiui.videoplayer.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class ActivationInfo implements Serializable {
|
||||
|
||||
int id;
|
||||
String sn;
|
||||
String out_trade_no;
|
||||
int pay_type;
|
||||
float total;
|
||||
String pay_time;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public String getOut_trade_no() {
|
||||
return out_trade_no;
|
||||
}
|
||||
|
||||
public void setOut_trade_no(String out_trade_no) {
|
||||
this.out_trade_no = out_trade_no;
|
||||
}
|
||||
|
||||
public int getPay_type() {
|
||||
return pay_type;
|
||||
}
|
||||
|
||||
public void setPay_type(int pay_type) {
|
||||
this.pay_type = pay_type;
|
||||
}
|
||||
|
||||
public float getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(float total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public String getPay_time() {
|
||||
return pay_time;
|
||||
}
|
||||
|
||||
public void setPay_time(String pay_time) {
|
||||
this.pay_time = pay_time;
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.trello.rxlifecycle4.android.FragmentEvent;
|
||||
import com.uiui.sn.manager.RemoteManager;
|
||||
import com.uiui.videoplayer.bean.ActivationInfo;
|
||||
import com.uiui.videoplayer.bean.BaseResponse;
|
||||
import com.uiui.videoplayer.bean.LocalVideoInfo;
|
||||
import com.uiui.videoplayer.bean.PhotoInfo;
|
||||
@@ -23,9 +24,8 @@ import com.uiui.videoplayer.disklrucache.CacheHelper;
|
||||
import com.uiui.videoplayer.gson.GsonUtils;
|
||||
import com.uiui.videoplayer.manager.ConnectManager;
|
||||
import com.uiui.videoplayer.manager.ConnectMode;
|
||||
import com.uiui.videoplayer.network.api.HomePhotoApi;
|
||||
import com.uiui.videoplayer.network.api.HomeSpaceInfoApi;
|
||||
import com.uiui.videoplayer.network.api.HomeVideoApi;
|
||||
import com.uiui.videoplayer.network.api.ActivationApi;
|
||||
import com.uiui.videoplayer.network.api.FileApi;
|
||||
import com.uiui.videoplayer.network.interceptor.RepeatRequestInterceptor;
|
||||
import com.uiui.videoplayer.utils.JGYUtils;
|
||||
import com.uiui.videoplayer.utils.ToastUtil;
|
||||
@@ -153,26 +153,33 @@ public class NetInterfaceManager {
|
||||
* */
|
||||
|
||||
public Observable<BaseResponse<List<VideoInfo>>> getHomeVideoControl() {
|
||||
return mRetrofit.create(HomeVideoApi.class)
|
||||
return mRetrofit.create(FileApi.class)
|
||||
.getHomeVideo(RemoteManager.getInstance().getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<ArrayList<PhotoInfo>>> getHomePhotoControl() {
|
||||
return mRetrofit.create(HomePhotoApi.class)
|
||||
return mRetrofit.create(FileApi.class)
|
||||
.getHomePhoto(RemoteManager.getInstance().getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<SpaceInfo>> getHomeSpaceInfoControl() {
|
||||
return mRetrofit.create(HomeSpaceInfoApi.class)
|
||||
return mRetrofit.create(FileApi.class)
|
||||
.getHomeSpaceInfo(RemoteManager.getInstance().getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<ActivationInfo>> getActivationControl() {
|
||||
return mRetrofit.create(ActivationApi.class)
|
||||
.getActivation(RemoteManager.getInstance().getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public interface onVideoPathCallback {
|
||||
void setVideoList(ArrayList<LocalVideoInfo> videoList);
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ public class UrlAddress {
|
||||
public static final String HOME_PHOTO ="File/getHomePhoto";
|
||||
/*获取家庭空间信息*/
|
||||
public static final String GET_HOME_SPACE_INFO ="File/getHomeSpaceInfo";
|
||||
/*获取设备激活支付信息*/
|
||||
public static final String ACTIVATION_INFO = "sn/act-info";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package com.uiui.videoplayer.network.api;
|
||||
|
||||
import com.uiui.videoplayer.bean.ActivationInfo;
|
||||
import com.uiui.videoplayer.bean.BaseResponse;
|
||||
import com.uiui.videoplayer.bean.SpaceInfo;
|
||||
import com.uiui.videoplayer.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface HomeSpaceInfoApi {
|
||||
@GET(UrlAddress.GET_HOME_SPACE_INFO)
|
||||
Observable<BaseResponse<SpaceInfo>> getHomeSpaceInfo(
|
||||
public interface ActivationApi {
|
||||
@GET(UrlAddress.ACTIVATION_INFO)
|
||||
Observable<BaseResponse<ActivationInfo>> getActivation(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -2,6 +2,8 @@ package com.uiui.videoplayer.network.api;
|
||||
|
||||
import com.uiui.videoplayer.bean.BaseResponse;
|
||||
import com.uiui.videoplayer.bean.PhotoInfo;
|
||||
import com.uiui.videoplayer.bean.SpaceInfo;
|
||||
import com.uiui.videoplayer.bean.VideoInfo;
|
||||
import com.uiui.videoplayer.network.UrlAddress;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -11,9 +13,19 @@ import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface HomePhotoApi {
|
||||
public interface FileApi {
|
||||
@GET(UrlAddress.HOME_VIDEO)
|
||||
Observable<BaseResponse<List<VideoInfo>>> getHomeVideo(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.HOME_PHOTO)
|
||||
Observable<BaseResponse<ArrayList<PhotoInfo>>> getHomePhoto(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@GET(UrlAddress.GET_HOME_SPACE_INFO)
|
||||
Observable<BaseResponse<SpaceInfo>> getHomeSpaceInfo(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.uiui.videoplayer.network.api;
|
||||
|
||||
import com.uiui.videoplayer.bean.BaseResponse;
|
||||
import com.uiui.videoplayer.bean.VideoInfo;
|
||||
import com.uiui.videoplayer.network.UrlAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface HomeVideoApi {
|
||||
@GET(UrlAddress.HOME_VIDEO)
|
||||
Observable<BaseResponse<List<VideoInfo>>> getHomeVideo(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -36,7 +35,7 @@ public class CustomDialog extends Dialog {
|
||||
/**
|
||||
* 确认和取消按钮
|
||||
*/
|
||||
private Button negtiveBn, positiveBn;
|
||||
private TextView negtiveBn, positiveBn;
|
||||
|
||||
/**
|
||||
* 按钮之间的分割线
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="400dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="320dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@drawable/bg_dialog"
|
||||
android:minWidth="260dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="8dp">
|
||||
android:paddingTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -30,7 +31,7 @@
|
||||
android:layout_marginRight="16dp"
|
||||
android:maxWidth="80dp"
|
||||
android:maxHeight="80dp"
|
||||
android:visibility="visible" />
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
@@ -51,7 +52,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="48dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:gravity="center|left"
|
||||
android:lineSpacingExtra="3dp"
|
||||
@@ -74,11 +75,11 @@
|
||||
android:layout_marginBottom="32dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
<TextView
|
||||
android:id="@+id/positive"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="48dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bt_sure_selector"
|
||||
android:gravity="center"
|
||||
@@ -86,7 +87,7 @@
|
||||
android:paddingBottom="8dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="17sp"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -100,11 +101,11 @@
|
||||
android:background="#E4E4E4"
|
||||
android:visibility="gone" />
|
||||
|
||||
<Button
|
||||
<TextView
|
||||
android:id="@+id/negtive"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="48dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bt_cancel_selector"
|
||||
android:gravity="center"
|
||||
@@ -112,15 +113,14 @@
|
||||
android:paddingBottom="8dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="17sp"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0"
|
||||
tools:text="No" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user