Skip to content

Commit

Permalink
界面微调
Browse files Browse the repository at this point in the history
  • Loading branch information
SDL committed Jun 24, 2022
1 parent 2a3593d commit 39c5831
Show file tree
Hide file tree
Showing 16 changed files with 159 additions and 244 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public void onChanged(AbsXml absXml) {
.load(mVideo.pic)
.transform(new RoundTransformation(mVideo.pic)
.centerCorp(true)
.override(AutoSizeUtils.mm2px(mContext, 212), AutoSizeUtils.mm2px(mContext, 300))
.override(AutoSizeUtils.mm2px(mContext, 300), AutoSizeUtils.mm2px(mContext, 400))
.roundRadius(AutoSizeUtils.mm2px(mContext, 10), RoundTransformation.RoundType.ALL))
.placeholder(R.drawable.error_all_loading)
.error(R.drawable.error_all_loading)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import com.github.tvbox.osc.api.ApiConfig;
import com.github.tvbox.osc.base.BaseActivity;
import com.github.tvbox.osc.base.BaseLazyFragment;
import com.github.tvbox.osc.event.RefreshEvent;
import com.github.tvbox.osc.ui.adapter.SettingPageAdapter;
import com.github.tvbox.osc.ui.adapter.SettingSortAdapter;
import com.github.tvbox.osc.ui.fragment.ModelSettingFragment;
Expand All @@ -25,9 +24,6 @@
import com.owen.tvrecyclerview.widget.TvRecyclerView;
import com.owen.tvrecyclerview.widget.V7LinearLayoutManager;

import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -115,7 +111,7 @@ private void initData() {
if (homeSourceSort == null)
homeSourceSort = "";
List<String> sortList = new ArrayList<>();
sortList.add("站点数据源");
sortList.add("数据源");
sortList.add("设置其他");
sortAdapter.setNewData(sortList);
initViewPager();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected void convert(BaseViewHolder helper, Movie.Video item) {
.load(item.pic)
.transform(new RoundTransformation(MD5.string2MD5(item.pic + "position=" + helper.getLayoutPosition()))
.centerCorp(true)
.override(AutoSizeUtils.mm2px(mContext, 212), AutoSizeUtils.mm2px(mContext, 300))
.override(AutoSizeUtils.mm2px(mContext, 300), AutoSizeUtils.mm2px(mContext, 400))
.roundRadius(AutoSizeUtils.mm2px(mContext, 10), RoundTransformation.RoundType.ALL))
.placeholder(R.drawable.error_loading)
.error(R.drawable.error_loading)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected void convert(BaseViewHolder helper, VodInfo item) {
.load(item.pic)
.transform(new RoundTransformation(MD5.string2MD5(item.pic + item.note))
.centerCorp(true)
.override(AutoSizeUtils.mm2px(mContext, 212), AutoSizeUtils.mm2px(mContext, 300))
.override(AutoSizeUtils.mm2px(mContext, 300), AutoSizeUtils.mm2px(mContext, 400))
.roundRadius(AutoSizeUtils.mm2px(mContext, 10), RoundTransformation.RoundType.ALL))
.placeholder(R.drawable.error_loading)
.error(R.drawable.error_loading)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import com.github.tvbox.osc.base.BaseLazyFragment;
import com.github.tvbox.osc.bean.AbsXml;
import com.github.tvbox.osc.bean.Movie;
import com.github.tvbox.osc.event.TopStateEvent;
import com.github.tvbox.osc.ui.activity.DetailActivity;
import com.github.tvbox.osc.ui.adapter.GridAdapter;
import com.github.tvbox.osc.ui.tv.widget.LoadMoreView;
Expand All @@ -21,8 +20,6 @@
import com.owen.tvrecyclerview.widget.TvRecyclerView;
import com.owen.tvrecyclerview.widget.V7GridLayoutManager;

import org.greenrobot.eventbus.EventBus;

/**
* @author pj567
* @date :2020/12/21
Expand Down Expand Up @@ -80,7 +77,7 @@ public void onItemPreSelected(TvRecyclerView parent, View itemView, int position

@Override
public void onItemSelected(TvRecyclerView parent, View itemView, int position) {
itemView.animate().scaleX(1.1f).scaleY(1.1f).setDuration(300).setInterpolator(new BounceInterpolator()).start();
itemView.animate().scaleX(1.05f).scaleY(1.05f).setDuration(300).setInterpolator(new BounceInterpolator()).start();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
*/
public class ModelSettingFragment extends BaseLazyFragment {
private TextView tvDebugOpen;
private TextView tvTestChannel;
private TextView tvMediaCodec;
private TextView tvParseWebView;
private TextView tvPlay;
Expand All @@ -59,7 +58,6 @@ protected int getLayoutResID() {
@Override
protected void init() {
tvDebugOpen = findViewById(R.id.tvDebugOpen);
tvTestChannel = findViewById(R.id.tvTestChannel);
tvParseWebView = findViewById(R.id.tvParseWebView);
tvMediaCodec = findViewById(R.id.tvMediaCodec);
tvPlay = findViewById(R.id.tvPlay);
Expand All @@ -68,7 +66,6 @@ protected void init() {
tvApi = findViewById(R.id.tvApi);
tvMediaCodec.setText(Hawk.get(HawkConfig.IJK_CODEC, ""));
tvDebugOpen.setText(Hawk.get(HawkConfig.DEBUG_OPEN, false) ? "已打开" : "已关闭");
tvTestChannel.setText(Hawk.get(HawkConfig.TEST_CHANNEL, false) ? "已打开" : "已关闭");
tvParseWebView.setText(Hawk.get(HawkConfig.PARSE_WEBVIEW, true) ? "系统自带" : "XWalkView");
tvXWalkDown.setText(XWalkUtils.xWalkLibExist(mContext) ? "已下载" : "未下载");
tvApi.setText(Hawk.get(HawkConfig.API_URL, ""));
Expand All @@ -83,14 +80,6 @@ public void onClick(View v) {
tvDebugOpen.setText(Hawk.get(HawkConfig.DEBUG_OPEN, false) ? "已打开" : "已关闭");
}
});
findViewById(R.id.llTest).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FastClickCheckUtil.check(v);
Hawk.put(HawkConfig.TEST_CHANNEL, !Hawk.get(HawkConfig.TEST_CHANNEL, false));
tvTestChannel.setText(Hawk.get(HawkConfig.TEST_CHANNEL, false) ? "已打开" : "已关闭");
}
});
findViewById(R.id.llStorage).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand Down Expand Up @@ -234,7 +223,6 @@ public void onChange() {
@Override
public void onChange() {
findViewById(R.id.llDebug).setVisibility(View.VISIBLE);
findViewById(R.id.llTest).setVisibility(View.VISIBLE);
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import com.github.tvbox.osc.bean.SourceBean;
import com.github.tvbox.osc.receiver.CustomWebReceiver;
import com.github.tvbox.osc.ui.adapter.SourceSettingAdapter;
import com.github.tvbox.osc.ui.dialog.SourceSetDialog;
import com.github.tvbox.osc.ui.dialog.SpeedTestDialog;
import com.github.tvbox.osc.util.FastClickCheckUtil;
import com.owen.tvrecyclerview.widget.TvRecyclerView;
Expand Down Expand Up @@ -51,7 +50,7 @@ protected void init() {
mGridView.setAdapter(settingAdapter);
mGridView.setLayoutManager(new V7GridLayoutManager(getContext(), 5));
List<SourceBean> sourceBeans = new ArrayList<>();
sourceBeans.add(SourceBean.speedTestBean);
// sourceBeans.add(SourceBean.speedTestBean);
sourceBeans.addAll(ApiConfig.get().getSourceBeanList());
settingAdapter.setNewData(sourceBeans);
settingAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
Expand All @@ -63,7 +62,11 @@ public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
SpeedTestDialog dialog = new SpeedTestDialog().build(mContext);
dialog.show();
} else {
SourceSetDialog dialog = new SourceSetDialog()
int preHome = settingAdapter.getData().indexOf(ApiConfig.get().getHomeSourceBean());
ApiConfig.get().setSourceBean(sourceBean);
settingAdapter.notifyItemChanged(preHome);
settingAdapter.notifyItemChanged(position);
/*SourceSetDialog dialog = new SourceSetDialog()
.bean(sourceBean)
.OnChangeSrcListener(new SourceSetDialog.OnChangeSrcListener() {
@Override
Expand All @@ -84,7 +87,7 @@ public void onDelete() {
settingAdapter.remove(position);
}
}).build(SourceSettingFragment.this);
dialog.show();
dialog.show();*/
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public class HawkConfig {
public static final String DEFAULT_PARSE = "parse_default";
public static final String DEBUG_OPEN = "debug_open";
public static final String PARSE_WEBVIEW = "parse_webview"; // true 系统 false xwalk
public static final String TEST_CHANNEL = "test_channel"; // true 本地 false 远端
public static final String IJK_CODEC = "ijk_codec";
public static final String LIVE_CHANNEL = "last_live_channel_name";
public static final String PLAY_TYPE = "play_type";//0 系统;1 ijk;2 exo
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/drawable/setting_model_focus.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true">
<shape>
<corners android:radius="5mm" />
<corners android:radius="@dimen/vs_5" />
<solid android:color="@color/color_6632364E" />
<stroke android:width="2mm" android:color="@android:color/white" />
<stroke android:width="@dimen/vs_2" android:color="@android:color/white" />
</shape>
</item>
<item android:state_focused="false">
<shape>
<corners android:radius="5mm" />
<corners android:radius="@dimen/vs_5" />
<solid android:color="@color/color_6632364E" />
</shape>
</item>
Expand Down
24 changes: 7 additions & 17 deletions app/src/main/res/layout/activity_setting.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,20 @@
android:orientation="horizontal">

<LinearLayout
android:layout_width="200mm"
android:layout_width="@dimen/vs_180"
android:layout_height="match_parent"
android:background="@color/color_6632364E"
android:orientation="vertical"
android:paddingTop="30mm">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="60mm"
android:drawableLeft="@drawable/search_line"
android:drawablePadding="10mm"
android:gravity="center"
android:text="设置"
android:textColor="@android:color/white"
android:textSize="24mm"
android:textStyle="bold" />
android:paddingLeft="@dimen/vs_10"
android:paddingTop="@dimen/vs_20"
android:paddingRight="@dimen/vs_10"
android:paddingBottom="@dimen/vs_20">

<com.owen.tvrecyclerview.widget.TvRecyclerView
android:id="@+id/mGridView"
android:layout_width="170mm"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginTop="20mm" />
android:layout_gravity="center" />
</LinearLayout>

<com.github.tvbox.osc.ui.tv.widget.NoScrollViewPager
Expand Down
21 changes: 12 additions & 9 deletions app/src/main/res/layout/fragment_grid.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="vertical">

<com.owen.tvrecyclerview.widget.TvRecyclerView
android:id="@+id/mGridView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false"
android:paddingLeft="60mm"
android:paddingTop="20mm"
android:paddingRight="60mm"
android:paddingBottom="20mm"
app:tv_horizontalSpacingWithMargins="20mm"
android:paddingLeft="@dimen/vs_60"
android:paddingTop="@dimen/vs_10"
android:paddingRight="@dimen/vs_60"
android:paddingBottom="@dimen/vs_10"
app:tv_horizontalSpacingWithMargins="@dimen/vs_10"
app:tv_selectedItemIsCentered="true"
app:tv_verticalSpacingWithMargins="30mm" />
</FrameLayout>
app:tv_verticalSpacingWithMargins="@dimen/vs_10" />
</LinearLayout>
Loading

0 comments on commit 39c5831

Please sign in to comment.