version:2.3
fix: update:更新应用卸载安装时桌面实时添加数据
This commit is contained in:
@@ -16,8 +16,8 @@ android {
|
|||||||
applicationId "com.uiui.aios"
|
applicationId "com.uiui.aios"
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 13
|
versionCode 14
|
||||||
versionName "2.2"
|
versionName "2.3"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.uiui.aios.activity;
|
|||||||
|
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
|
||||||
import androidx.viewpager.widget.ViewPager;
|
import androidx.viewpager.widget.ViewPager;
|
||||||
@@ -37,6 +38,8 @@ public class CodeActivity extends BaseActivity {
|
|||||||
ViewPager mViewPager;
|
ViewPager mViewPager;
|
||||||
@BindView(R.id.magicIndicator)
|
@BindView(R.id.magicIndicator)
|
||||||
MagicIndicator mMagicIndicator;
|
MagicIndicator mMagicIndicator;
|
||||||
|
@BindView(R.id.iv_nodata)
|
||||||
|
ImageView iv_nodata;
|
||||||
|
|
||||||
private HealthCodeAdapter mHealthCodeAdapter;
|
private HealthCodeAdapter mHealthCodeAdapter;
|
||||||
private ScaleCircleNavigator scaleCircleNavigator;
|
private ScaleCircleNavigator scaleCircleNavigator;
|
||||||
@@ -102,8 +105,13 @@ public class CodeActivity extends BaseActivity {
|
|||||||
if (listBaseResponse.code == 200) {
|
if (listBaseResponse.code == 200) {
|
||||||
List<HealthCode> healthCodeList = listBaseResponse.data;
|
List<HealthCode> healthCodeList = listBaseResponse.data;
|
||||||
setImageViews(healthCodeList);
|
setImageViews(healthCodeList);
|
||||||
|
mViewPager.setVisibility(View.VISIBLE);
|
||||||
|
mMagicIndicator.setVisibility(View.VISIBLE);
|
||||||
|
iv_nodata.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
|
mViewPager.setVisibility(View.GONE);
|
||||||
|
mMagicIndicator.setVisibility(View.GONE);
|
||||||
|
iv_nodata.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import android.provider.Settings;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
@@ -43,6 +44,11 @@ import com.uiui.aios.view.ScaleCircleNavigator;
|
|||||||
|
|
||||||
import net.lucode.hackware.magicindicator.MagicIndicator;
|
import net.lucode.hackware.magicindicator.MagicIndicator;
|
||||||
import net.lucode.hackware.magicindicator.ViewPagerHelper;
|
import net.lucode.hackware.magicindicator.ViewPagerHelper;
|
||||||
|
import net.lucode.hackware.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||||
|
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter;
|
||||||
|
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
|
||||||
|
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerTitleView;
|
||||||
|
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ClipPagerTitleView;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -62,6 +68,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
|||||||
|
|
||||||
private FragmentManager mFragmentManager;
|
private FragmentManager mFragmentManager;
|
||||||
private FragmentTransaction mFragmentTransaction;
|
private FragmentTransaction mFragmentTransaction;
|
||||||
|
private ScaleCircleNavigator scaleCircleNavigator;
|
||||||
private BaseFragmentPagerAdapter mBaseFragmentPagerAdapter;
|
private BaseFragmentPagerAdapter mBaseFragmentPagerAdapter;
|
||||||
private List<Fragment> mFragments;
|
private List<Fragment> mFragments;
|
||||||
private CustomFragment mCustomFragment;
|
private CustomFragment mCustomFragment;
|
||||||
@@ -108,7 +115,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ScaleCircleNavigator scaleCircleNavigator = new ScaleCircleNavigator(this);
|
scaleCircleNavigator = new ScaleCircleNavigator(this);
|
||||||
scaleCircleNavigator.setCircleCount(mFragments.size());
|
scaleCircleNavigator.setCircleCount(mFragments.size());
|
||||||
scaleCircleNavigator.setNormalCircleColor(Color.DKGRAY);
|
scaleCircleNavigator.setNormalCircleColor(Color.DKGRAY);
|
||||||
scaleCircleNavigator.setSelectedCircleColor(Color.LTGRAY);
|
scaleCircleNavigator.setSelectedCircleColor(Color.LTGRAY);
|
||||||
@@ -120,6 +127,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mViewPager.setAdapter(mBaseFragmentPagerAdapter);
|
mViewPager.setAdapter(mBaseFragmentPagerAdapter);
|
||||||
|
mViewPager.setOffscreenPageLimit(3);
|
||||||
mMagicIndicator.setNavigator(scaleCircleNavigator);
|
mMagicIndicator.setNavigator(scaleCircleNavigator);
|
||||||
ViewPagerHelper.bind(mMagicIndicator, mViewPager);
|
ViewPagerHelper.bind(mMagicIndicator, mViewPager);
|
||||||
if (mFragments.size() > 1) {
|
if (mFragments.size() > 1) {
|
||||||
@@ -198,7 +206,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
|||||||
private final static int APP_LIST_SIZE = 3 * 4;
|
private final static int APP_LIST_SIZE = 3 * 4;
|
||||||
|
|
||||||
private void addData() {
|
private void addData() {
|
||||||
Log.e(TAG, "addData: " );
|
Log.e(TAG, "addData: ");
|
||||||
List<Fragment> fragmentList = new ArrayList<>();
|
List<Fragment> fragmentList = new ArrayList<>();
|
||||||
ArrayList<DesktopIcon> applicationInfoList = ApkUtils.queryFilterAppInfo(this);
|
ArrayList<DesktopIcon> applicationInfoList = ApkUtils.queryFilterAppInfo(this);
|
||||||
int x = 0;
|
int x = 0;
|
||||||
@@ -215,16 +223,23 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//从第三个开始改
|
//从第三个开始改
|
||||||
for (int i = 2; i <= fragmentList.size(); i++) {
|
for (int i = 0; i < fragmentList.size(); i++) {
|
||||||
if (mFragments.get(i) != null) {
|
if (i + 2 < mFragments.size()) {
|
||||||
mBaseFragmentPagerAdapter.replaceFragment(i, fragmentList.get(i - 2));
|
mBaseFragmentPagerAdapter.replaceFragment(i + 2, fragmentList.get(i));
|
||||||
mFragments.remove(i);
|
// mFragments.remove(i + 2);
|
||||||
mFragments.add(i, fragmentList.get(i - 2));
|
// mFragments.add(i + 2, fragmentList.get(i));
|
||||||
} else {
|
} else {
|
||||||
mBaseFragmentPagerAdapter.addFragment(fragmentList.get(i - 2));
|
// mFragments.add(fragmentList.get(i));
|
||||||
mFragments.add(fragmentList.get(i - 2));
|
// mBaseFragmentPagerAdapter.getFragments();
|
||||||
|
mBaseFragmentPagerAdapter.addFragment(fragmentList.get(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (int i = mFragments.size(); i > fragmentList.size() + 2; i--) {
|
||||||
|
mFragments.remove(i - 1);
|
||||||
|
}
|
||||||
|
scaleCircleNavigator.setCircleCount(mFragments.size());
|
||||||
|
scaleCircleNavigator.notifyDataSetChanged();
|
||||||
|
mBaseFragmentPagerAdapter.notifyItemChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ public class BaseFragmentPagerAdapter extends FragmentPagerAdapter {
|
|||||||
notifyItemChanged();
|
notifyItemChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void notifyItemChanged() {
|
public void notifyItemChanged() {
|
||||||
//刷新之前重新收集位置信息
|
//刷新之前重新收集位置信息
|
||||||
setFragmentPositionMapForUpdate();
|
setFragmentPositionMapForUpdate();
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.uiui.aios.fragment;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentManager;
|
||||||
|
import androidx.lifecycle.Lifecycle;
|
||||||
|
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class CustomPagerAdapter extends FragmentStateAdapter {
|
||||||
|
List<Fragment> fragmentList;
|
||||||
|
|
||||||
|
public CustomPagerAdapter(FragmentManager fm, List<Fragment> fragmentList, Lifecycle lifecycle) {
|
||||||
|
super(fm, lifecycle);
|
||||||
|
this.fragmentList = fragmentList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public Fragment createFragment(int position) {
|
||||||
|
return fragmentList.get(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return fragmentList.size();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -269,13 +269,17 @@ public class SecondFragment extends BaseFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void openApp(int position) {
|
private void openApp(int position) {
|
||||||
Intent intent = new Intent(Intent.ACTION_MAIN);
|
try {
|
||||||
/*知道要跳转应用的包命与目标Activity*/
|
Intent intent = new Intent(Intent.ACTION_MAIN);
|
||||||
ComponentName componentName = new ComponentName("com.uiui.city", "com.uiui.city.activity.MainActivity");
|
/*知道要跳转应用的包命与目标Activity*/
|
||||||
intent.putExtra("position", position);
|
ComponentName componentName = new ComponentName("com.uiui.city", "com.uiui.city.activity.MainActivity");
|
||||||
intent.setComponent(componentName);
|
intent.putExtra("position", position);
|
||||||
intent.putExtra("", "");//这里Intent传值
|
intent.setComponent(componentName);
|
||||||
startActivity(intent);
|
intent.putExtra("", "");//这里Intent传值
|
||||||
|
startActivity(intent);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e(TAG, "openApp: " + e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getGoods() {
|
private void getGoods() {
|
||||||
|
|||||||
227
app/src/main/java/com/uiui/aios/fragment/ViewPager2Adapter.java
Normal file
227
app/src/main/java/com/uiui/aios/fragment/ViewPager2Adapter.java
Normal file
@@ -0,0 +1,227 @@
|
|||||||
|
package com.uiui.aios.fragment;
|
||||||
|
|
||||||
|
import android.util.SparseArray;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentManager;
|
||||||
|
import androidx.fragment.app.FragmentPagerAdapter;
|
||||||
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
|
import androidx.lifecycle.Lifecycle;
|
||||||
|
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载显示Fragment的ViewPagerAdapter基类
|
||||||
|
* 提供可以刷新的方法
|
||||||
|
*
|
||||||
|
* @author Fly
|
||||||
|
* @e-mail 1285760616@qq.com
|
||||||
|
* @time 2018/3/22
|
||||||
|
*/
|
||||||
|
public class ViewPager2Adapter extends FragmentStateAdapter {
|
||||||
|
private List<Fragment> mFragmentList;
|
||||||
|
private FragmentManager mFragmentManager;
|
||||||
|
/**
|
||||||
|
* 下面两个值用来保存Fragment的位置信息,用以判断该位置是否需要更新
|
||||||
|
*/
|
||||||
|
private SparseArray<String> mFragmentPositionMap;
|
||||||
|
private SparseArray<String> mFragmentPositionMapAfterUpdate;
|
||||||
|
|
||||||
|
public ViewPager2Adapter(FragmentManager fm, List<Fragment> fragments, Lifecycle lifecycle) {
|
||||||
|
super(fm, lifecycle);
|
||||||
|
mFragmentList = fragments;
|
||||||
|
mFragmentManager = fm;
|
||||||
|
mFragmentList = fragments;
|
||||||
|
mFragmentPositionMap = new SparseArray<>();
|
||||||
|
mFragmentPositionMapAfterUpdate = new SparseArray<>();
|
||||||
|
setFragmentPositionMap();
|
||||||
|
setFragmentPositionMapForUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存更新之前的位置信息,用<hashCode, position>的键值对结构来保存
|
||||||
|
*/
|
||||||
|
private void setFragmentPositionMap() {
|
||||||
|
mFragmentPositionMap.clear();
|
||||||
|
for (int i = 0; i < mFragmentList.size(); i++) {
|
||||||
|
mFragmentPositionMap.put(Long.valueOf(getItemId(i)).intValue(), String.valueOf(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存更新之后的位置信息,用<hashCode, position>的键值对结构来保存
|
||||||
|
*/
|
||||||
|
private void setFragmentPositionMapForUpdate() {
|
||||||
|
mFragmentPositionMapAfterUpdate.clear();
|
||||||
|
for (int i = 0; i < mFragmentList.size(); i++) {
|
||||||
|
mFragmentPositionMapAfterUpdate.put(Long.valueOf(getItemId(i)).intValue(), String.valueOf(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 在此方法中找到需要更新的位置返回POSITION_NONE,否则返回POSITION_UNCHANGED即可
|
||||||
|
// */
|
||||||
|
// @Override
|
||||||
|
// public int getItemPosition(Object object) {
|
||||||
|
// int hashCode = object.hashCode();
|
||||||
|
// //查找object在更新后的列表中的位置
|
||||||
|
// String position = mFragmentPositionMapAfterUpdate.get(hashCode);
|
||||||
|
// //更新后的列表中不存在该object的位置了
|
||||||
|
// if (position == null) {
|
||||||
|
// return POSITION_NONE;
|
||||||
|
// } else {
|
||||||
|
// //如果更新后的列表中存在该object的位置, 查找该object之前的位置并判断位置是否发生了变化
|
||||||
|
// int size = mFragmentPositionMap.size();
|
||||||
|
// for (int i = 0; i < size ; i++) {
|
||||||
|
// int key = mFragmentPositionMap.keyAt(i);
|
||||||
|
// if (key == hashCode) {
|
||||||
|
// String index = mFragmentPositionMap.get(key);
|
||||||
|
// if (position.equals(index)) {
|
||||||
|
// //位置没变依然返回POSITION_UNCHANGED
|
||||||
|
// return POSITION_UNCHANGED;
|
||||||
|
// } else {
|
||||||
|
// //位置变了
|
||||||
|
// return POSITION_NONE;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return POSITION_UNCHANGED;
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将指定的Fragment替换/更新为新的Fragment
|
||||||
|
*
|
||||||
|
* @param oldFragment 旧Fragment
|
||||||
|
* @param newFragment 新Fragment
|
||||||
|
*/
|
||||||
|
public void replaceFragment(Fragment oldFragment, Fragment newFragment) {
|
||||||
|
int position = mFragmentList.indexOf(oldFragment);
|
||||||
|
if (position == -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//从Transaction移除旧的Fragment
|
||||||
|
removeFragmentInternal(oldFragment);
|
||||||
|
//替换List中对应的Fragment
|
||||||
|
mFragmentList.set(position, newFragment);
|
||||||
|
//刷新Adapter
|
||||||
|
notifyItemChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将指定位置的Fragment替换/更新为新的Fragment,同{@link #replaceFragment(Fragment oldFragment, Fragment newFragment)}
|
||||||
|
*
|
||||||
|
* @param position 旧Fragment的位置
|
||||||
|
* @param newFragment 新Fragment
|
||||||
|
*/
|
||||||
|
public void replaceFragment(int position, Fragment newFragment) {
|
||||||
|
Fragment oldFragment = mFragmentList.get(position);
|
||||||
|
removeFragmentInternal(oldFragment);
|
||||||
|
mFragmentList.set(position, newFragment);
|
||||||
|
notifyItemChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移除指定的Fragment
|
||||||
|
*
|
||||||
|
* @param fragment 目标Fragment
|
||||||
|
*/
|
||||||
|
public void removeFragment(Fragment fragment) {
|
||||||
|
//先从List中移除
|
||||||
|
mFragmentList.remove(fragment);
|
||||||
|
//然后从Transaction移除
|
||||||
|
removeFragmentInternal(fragment);
|
||||||
|
//最后刷新Adapter
|
||||||
|
notifyItemChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移除指定位置的Fragment,同 {@link #removeFragment(Fragment fragment)}
|
||||||
|
*
|
||||||
|
* @param position
|
||||||
|
*/
|
||||||
|
public void removeFragment(int position) {
|
||||||
|
Fragment fragment = mFragmentList.get(position);
|
||||||
|
//然后从List中移除
|
||||||
|
mFragmentList.remove(fragment);
|
||||||
|
//先从Transaction移除
|
||||||
|
removeFragmentInternal(fragment);
|
||||||
|
//最后刷新Adapter
|
||||||
|
notifyItemChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加Fragment
|
||||||
|
*
|
||||||
|
* @param fragment 目标Fragment
|
||||||
|
*/
|
||||||
|
public void addFragment(Fragment fragment) {
|
||||||
|
mFragmentList.add(fragment);
|
||||||
|
notifyItemChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在指定位置插入一个Fragment
|
||||||
|
*
|
||||||
|
* @param position 插入位置
|
||||||
|
* @param fragment 目标Fragment
|
||||||
|
*/
|
||||||
|
public void insertFragment(int position, Fragment fragment) {
|
||||||
|
mFragmentList.add(position, fragment);
|
||||||
|
notifyItemChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void notifyItemChanged() {
|
||||||
|
//刷新之前重新收集位置信息
|
||||||
|
setFragmentPositionMapForUpdate();
|
||||||
|
notifyDataSetChanged();
|
||||||
|
setFragmentPositionMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从Transaction移除Fragment
|
||||||
|
*
|
||||||
|
* @param fragment 目标Fragment
|
||||||
|
*/
|
||||||
|
private void removeFragmentInternal(Fragment fragment) {
|
||||||
|
FragmentTransaction transaction = mFragmentManager.beginTransaction();
|
||||||
|
transaction.remove(fragment);
|
||||||
|
transaction.commitNow();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public Fragment createFragment(int position) {
|
||||||
|
return mFragmentList.get(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public Fragment getItem(int position) {
|
||||||
|
// return mFragmentList.get(position);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public int getCount() {
|
||||||
|
// return mFragmentList.size();
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 此方法不用position做返回值即可破解fragment tag异常的错误
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public long getItemId(int position) {
|
||||||
|
// 获取当前数据的hashCode,其实这里不用hashCode用自定义的可以关联当前Item对象的唯一值也可以,只要不是直接返回position
|
||||||
|
return mFragmentList.get(position).hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return mFragmentList.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Fragment> getFragments() {
|
||||||
|
return mFragmentList;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,4 +24,17 @@
|
|||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_nodata"
|
||||||
|
android:layout_width="160dp"
|
||||||
|
android:layout_height="160dp"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/nodata"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -24,4 +24,17 @@
|
|||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_nodata"
|
||||||
|
android:layout_width="160dp"
|
||||||
|
android:layout_height="160dp"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/nodata"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
Reference in New Issue
Block a user