[关闭]
@hx 2018-04-27T15:34:59.000000Z 字数 16873 阅读 1056

Android笔记

Android


Android应用界面开发
自定义控件与Handler
布局列表与列表控件
服务、广播与酷特性Widget
SharedPreferences与文件管理
SQLite和ContentProvider
网络编程和数据处理
多线程
进程与服务
传感器与LBS
Gradle、依赖

下拉框Spinner控件

1.布局文件中,spinnerMode:dropdown | dialog

  1. <Spinner
  2. android:id="@+id/spinner"
  3. android:layout_width="wrap_content"
  4. android:spinnerMode="dialog"
  5. android:layout_height="wrap_content"/>

2.Java代码

  1. public class MainActivity extends AppCompatActivity {
  2. private ArrayAdapter<String> mArrayAdapter;
  3. private ArrayList<String> mArrayList;
  4. @Override
  5. protected void onCreate(Bundle savedInstanceState) {
  6. super.onCreate(savedInstanceState);
  7. setContentView(R.layout.activity_main);
  8. Spinner spinner = (Spinner) findViewById(R.id.spinner);
  9. // SpinnerMode 为 Dropdown时可设置下拉背景。
  10. spinner.setPopupBackgroundResource(R.drawable.tp);
  11. // Mode为dialog时的提示消息。
  12. spinner.setPrompt("请选择城市");
  13. initDatas();
  14. mArrayAdapter = new ArrayAdapter<>(this, R.layout.support_simple_spinner_dropdown_item, mArrayList);
  15. spinner.setAdapter(mArrayAdapter);
  16. spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
  17. @Override
  18. public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
  19. Toast.makeText(getApplicationContext(), "您选择的城市:" + mArrayList.get(i), Toast.LENGTH_SHORT).show();
  20. }
  21. @Override
  22. public void onNothingSelected(AdapterView<?> adapterView) {
  23. }
  24. });
  25. }
  26. private void initDatas() {
  27. mArrayList = new ArrayList<>();
  28. mArrayList.add("北京");
  29. mArrayList.add("上海");
  30. mArrayList.add("武汉");
  31. mArrayList.add("长春");
  32. }
  33. }

ProgressBar

  1. <ProgressBar
  2. style="@android:style/Widget.Material.ProgressBar.Horizontal"
  3. android:max="100" //进度条最大值
  4. android:progress="50" // 进度条初始值(0-100)
  5. android:secondaryProgress="70" // 第二进度条
  6. android:layout_width="match_parent"
  7. android:layout_height="wrap_content"/>

Style样式

  1. Widget.ProgressBar.Horizontal //水平进度条样式
  2. Widget.ProgressBar.Small //小进度条
  3. Widget.ProgressBar.Large //大进度条
  4. Widget.ProgressBar.Inverse //不断跳变并旋转的进度条
  5. Widget.ProgressBar.Small.Inverse //小的不断跳变并旋转的进度条
  6. Widget.ProgressBar.Large.Inverse //大的不变跳变并旋转的进度条

常用方法

方法 说明
incrementProgressBy(int value) 在原来的基础上每次增加value
setProgress 设置进度
setMax 设置进度条最大值
getProgress 获取当前进度
setSeconderyProgress 设置第二进度条进度

SeekBar

SeekBar继承自ProgressBar,属性基本相同,thumb属性可设置资源改变滑块样式。

  1. seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
  2. @Override
  3. public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
  4. textView.setText("开始滑动" + i);
  5. }
  6. @Override
  7. public void onStartTrackingTouch(SeekBar seekBar) {
  8. }
  9. @Override
  10. public void onStopTrackingTouch(SeekBar seekBar) {
  11. }
  12. });

ViewPager

API中对此类描述:

使用PagerTitleStrip

是一个非交互的当前页面指示器,一般指示ViewPager中的前一页、当前页和下一页三个页面。可以通过PagerTitleStrip标签添加到xml布局当中。我们可以设置layout_gravity属性为TOP或者BOTTOM来决定在页面顶部或者底部显示,添加PagerTitleStrip要在适配器中覆写getPageTitle方法。

1.布局文件
android:layout_gravity=""属性默认为Top

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout
  3. xmlns:android="http://schemas.android.com/apk/res/android"
  4. xmlns:tools="http://schemas.android.com/tools"
  5. android:layout_width="match_parent"
  6. android:layout_height="match_parent"
  7. android:orientation="vertical"
  8. tools:context="com.example.hx.newproject.MainActivity">
  9. <android.support.v4.view.ViewPager
  10. android:id="@+id/view_pager"
  11. android:layout_width="match_parent"
  12. android:layout_height="match_parent">
  13. <android.support.v4.view.PagerTitleStrip
  14. android:id="@+id/pager_title_strip"
  15. android:layout_width="match_parent"
  16. android:layout_height="wrap_content"
  17. android:layout_gravity="bottom">
  18. </android.support.v4.view.PagerTitleStrip>
  19. </android.support.v4.view.ViewPager>
  20. </LinearLayout>

2.子文件布局(3个,随意三个布局)
参见 上文“BaseAdapter适配器”的子文件布局。

3.自定义Adapter

  1. public class MyViewPagerAdapter extends PagerAdapter {
  2. private List<View> mList;
  3. private List<String> mTitles;
  4. MyViewPagerAdapter(List<View> list, List<String> titles) {
  5. this.mList = list;
  6. this.mTitles = titles;
  7. }
  8. // 返回页卡数量
  9. @Override
  10. public int getCount() {
  11. return mList.size();
  12. }
  13. // 判断View是否来自Object
  14. @Override
  15. public boolean isViewFromObject(View view, Object o) {
  16. return view == o;
  17. }
  18. // 初始化一个页卡
  19. @Override
  20. public Object instantiateItem(ViewGroup container, int position) {
  21. container.addView(mList.get(position));
  22. return mList.get(position);
  23. }
  24. // 销毁一个页卡
  25. @Override
  26. public void destroyItem(ViewGroup container, int position, Object object) {
  27. container.removeView(mList.get(position));
  28. }
  29. // 返回指示器title name
  30. @Override
  31. public CharSequence getPageTitle(int position) {
  32. return mTitles.get(position);
  33. }
  34. }

使用PagerTabStrip

只需将PaperTitleStrip布局文件中的android.support.v4.view.PagerTitleStrip替换成android.support.v4.view.PagerTabStrip即可。

添加addOnPageChangeListener方法设置换页监听。

  1. viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
  2. @Override
  3. public void onPageScrolled(int i, float v, int i1) {
  4. }
  5. @Override
  6. public void onPageSelected(int i) {
  7. // 当前页为 i。
  8. }
  9. @Override
  10. public void onPageScrollStateChanged(int i) {
  11. }
  12. });

除了直接添加布局文件外,还可以添加Fragment控件
FragmentPagerAdapterFragmentStatePagerAdapter

效果图

ViewPager+FragmentStatePagerAdapter实现仿微信Tab

FragmentPagerAdapter和FragmentStatePagerAdapter的区别:
FragmentStatePagerAdapter更适用于大量页面的情形,因为不被显示的页面会被回收,可以大大降低内存的使用率。在使用FragmentStatePagerAdapter作为适配器时,其余都不用改动,只要覆写instantiateItem(初始化子页面)和destroyItem(销毁子页面)两个方法即可

1.主布局文件

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout
  3. xmlns:android="http://schemas.android.com/apk/res/android"
  4. xmlns:tools="http://schemas.android.com/tools"
  5. android:layout_width="match_parent"
  6. android:layout_height="match_parent"
  7. android:orientation="vertical"
  8. tools:context="com.example.hx.newproject.MainActivity">
  9. <android.support.v4.view.ViewPager
  10. android:id="@+id/view_pager"
  11. android:layout_width="match_parent"
  12. android:layout_height="0dp"
  13. android:layout_weight="1">
  14. </android.support.v4.view.ViewPager>
  15. <include layout="@layout/nav_button"/>
  16. </LinearLayout>

2.@layout/nav_button底部导航布局

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout
  3. xmlns:android="http://schemas.android.com/apk/res/android"
  4. android:layout_width="match_parent"
  5. android:layout_height="56dp"
  6. android:background="@color/colorPrimary"
  7. android:orientation="horizontal">
  8. <LinearLayout
  9. android:id="@+id/work_list"
  10. android:layout_width="0dp"
  11. android:layout_height="match_parent"
  12. android:layout_weight="1"
  13. android:background="?android:attr/selectableItemBackground"
  14. android:gravity="center"
  15. android:orientation="vertical">
  16. <ImageView
  17. android:id="@+id/work_list_image_view"
  18. android:layout_width="32dp"
  19. android:layout_height="32dp"
  20. android:src="@drawable/ic_import_contacts_black_24dp"/>
  21. </LinearLayout>
  22. <LinearLayout
  23. android:id="@+id/forum"
  24. android:layout_width="0dp"
  25. android:layout_height="match_parent"
  26. android:layout_weight="1"
  27. android:background="?android:attr/selectableItemBackground"
  28. android:gravity="center"
  29. android:orientation="vertical">
  30. <ImageView
  31. android:id="@+id/forum_image_view"
  32. android:layout_width="32dp"
  33. android:layout_height="32dp"
  34. android:src="@drawable/ic_forum_white_24dp"/>
  35. </LinearLayout>
  36. <LinearLayout
  37. android:id="@+id/me"
  38. android:layout_width="0dp"
  39. android:layout_height="match_parent"
  40. android:layout_weight="1"
  41. android:background="?android:attr/selectableItemBackground"
  42. android:gravity="center"
  43. android:orientation="vertical">
  44. <ImageView
  45. android:id="@+id/me_image_view"
  46. android:layout_width="32dp"
  47. android:layout_height="32dp"
  48. android:src="@drawable/ic_person_white_24dp"/>
  49. </LinearLayout>
  50. </LinearLayout>

3.子布局文件(3个,随意三个布局)
参见 上文“BaseAdapter适配器”的子文件布局。

4.Fragment文件

  1. public class MyFragment1 extends Fragment {
  2. @Nullable
  3. @Override
  4. public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  5. return inflater.inflate(R.layout.item, null);
  6. }
  7. }

这些Fragment数据集只是布局文件不同,MyFragment2-MyFragment3类似。

5.Aapter代码

  1. public class ViewPagerFragmentAdapter extends FragmentStatePagerAdapter {
  2. private List<Fragment> mFragmentList;
  3. public ViewPagerFragmentAdapter(FragmentManager fm, List<Fragment> list) {
  4. super(fm);
  5. this.mFragmentList = list;
  6. }
  7. @Override
  8. public Fragment getItem(int position) {
  9. return mFragmentList.get(position);
  10. }
  11. @Override
  12. public int getCount() {
  13. return mFragmentList.size();
  14. }
  15. @Override
  16. public Object instantiateItem(ViewGroup container, int position) {
  17. return super.instantiateItem(container, position);
  18. }
  19. @Override
  20. public void destroyItem(ViewGroup container, int position, Object object) {
  21. super.destroyItem(container, position, object);
  22. }
  23. }

6.MainActivity

  1. public class MainActivity extends FragmentActivity implements View.OnClickListener {
  2. private List<Fragment> mFragmentList;
  3. private ViewPager mViewPager;
  4. private LinearLayout mWorkList;
  5. private LinearLayout mForum;
  6. private LinearLayout mMe;
  7. private ImageView mImageViewWorkList;
  8. private ImageView mImageViewForum;
  9. private ImageView mImageViewMe;
  10. @Override
  11. protected void onCreate(Bundle savedInstanceState) {
  12. super.onCreate(savedInstanceState);
  13. setContentView(R.layout.activity_main);
  14. initDatas(); // 初始化数据
  15. initViews(); // 初始化控件
  16. initEvent(); // 注册单击监听
  17. ViewPagerFragmentAdapter viewPagerFragmentAdapter =
  18. new ViewPagerFragmentAdapter(getSupportFragmentManager(), mFragmentList);
  19. mViewPager.setAdapter(viewPagerFragmentAdapter);
  20. }
  21. private void initDatas() {
  22. mFragmentList = new ArrayList<>();
  23. mFragmentList.add(new MyFragment1());
  24. mFragmentList.add(new MyFragment2());
  25. mFragmentList.add(new MyFragment3());
  26. }
  27. private void initViews() {
  28. mViewPager = (ViewPager) findViewById(R.id.view_pager);
  29. mWorkList = (LinearLayout) findViewById(R.id.work_list);
  30. mForum = (LinearLayout) findViewById(R.id.forum);
  31. mMe = (LinearLayout) findViewById(R.id.me);
  32. mImageViewWorkList = (ImageView) findViewById(R.id.work_list_image_view);
  33. mImageViewForum = (ImageView) findViewById(R.id.forum_image_view);
  34. mImageViewMe = (ImageView) findViewById(R.id.me_image_view);
  35. }
  36. private void initEvent() {
  37. mWorkList.setOnClickListener(this);
  38. mForum.setOnClickListener(this);
  39. mMe.setOnClickListener(this);
  40. // 设置ViewPager滑动监听
  41. mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
  42. @Override
  43. public void onPageScrolled(int i, float v, int i1) {
  44. }
  45. @Override
  46. public void onPageSelected(int i) {
  47. // 获取当前ViewPager页数
  48. int currentItem = mViewPager.getCurrentItem();
  49. resetImage();
  50. switch (currentItem) {
  51. case 0:
  52. mImageViewWorkList.setImageResource(R.drawable.ic_import_contacts_black_24dp);
  53. break;
  54. case 1:
  55. mImageViewForum.setImageResource(R.drawable.ic_forum_black_24dp);
  56. break;
  57. case 2:
  58. mImageViewMe.setImageResource(R.drawable.ic_person_black_24dp);
  59. break;
  60. }
  61. }
  62. @Override
  63. public void onPageScrollStateChanged(int i) {
  64. }
  65. });
  66. }
  67. // 重置图片
  68. private void resetImage() {
  69. mImageViewWorkList.setImageResource(R.drawable.ic_import_contacts_white_24dp);
  70. mImageViewForum.setImageResource(R.drawable.ic_forum_white_24dp);
  71. mImageViewMe.setImageResource(R.drawable.ic_person_white_24dp);
  72. }
  73. @Override
  74. public void onClick(View view) {
  75. resetImage();
  76. switch (view.getId()) {
  77. case R.id.work_list:
  78. // 设置当前页
  79. mViewPager.setCurrentItem(0);
  80. mImageViewWorkList.setImageResource(R.drawable.ic_import_contacts_black_24dp);
  81. break;
  82. case R.id.forum:
  83. mViewPager.setCurrentItem(1);
  84. mImageViewForum.setImageResource(R.drawable.ic_forum_black_24dp);
  85. break;
  86. case R.id.me:
  87. mViewPager.setCurrentItem(2);
  88. mImageViewMe.setImageResource(R.drawable.ic_person_black_24dp);
  89. break;
  90. }
  91. }
  92. }

123.gif-3445.2kB
演示视频

使用ColorMatrix改变图片颜色

1.主布局文件

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout
  3. xmlns:android="http://schemas.android.com/apk/res/android"
  4. android:layout_width="match_parent"
  5. android:layout_height="match_parent"
  6. android:layout_margin="16dp"
  7. android:gravity="center_horizontal"
  8. android:orientation="vertical">
  9. <TextView
  10. android:layout_width="wrap_content"
  11. android:layout_height="wrap_content"
  12. android:text="R"/>
  13. <SeekBar
  14. android:id="@+id/seek_bar_R"
  15. android:layout_width="match_parent"
  16. android:layout_height="wrap_content"
  17. android:max="255"
  18. android:progress="0"/>
  19. <TextView
  20. android:layout_width="wrap_content"
  21. android:layout_height="wrap_content"
  22. android:text="G"/>
  23. <SeekBar
  24. android:id="@+id/seek_bar_G"
  25. android:layout_width="match_parent"
  26. android:layout_height="wrap_content"
  27. android:max="255"
  28. android:progress="0"/>
  29. <TextView
  30. android:layout_width="wrap_content"
  31. android:layout_height="wrap_content"
  32. android:text="B"/>
  33. <SeekBar
  34. android:id="@+id/seek_bar_B"
  35. android:layout_width="match_parent"
  36. android:layout_height="wrap_content"
  37. android:max="255"
  38. android:progress="0"/>
  39. <TextView
  40. android:layout_width="wrap_content"
  41. android:layout_height="wrap_content"
  42. android:text="A"/>
  43. <SeekBar
  44. android:id="@+id/seek_bar_A"
  45. android:layout_width="match_parent"
  46. android:layout_height="wrap_content"
  47. android:max="255"
  48. android:progress="255"/>
  49. <ImageView
  50. android:id="@+id/matrix_image_view"
  51. android:layout_width="wrap_content"
  52. android:layout_height="wrap_content"
  53. android:src="@drawable/ic_import_contacts_black_24dp"/>
  54. </LinearLayout>

2.MainActivity

  1. public class MatrixActivity extends AppCompatActivity {
  2. private Bitmap mBitmap;
  3. private Bitmap mAfterBitmap;
  4. private Canvas mCanvas;
  5. private Paint mPaint;
  6. private ImageView mImageView;
  7. private SeekBar mSeekBarR;
  8. private SeekBar mSeekBarG;
  9. private SeekBar mSeekBarB;
  10. private SeekBar mSeekBarA;
  11. @Override
  12. protected void onCreate(@Nullable Bundle savedInstanceState) {
  13. super.onCreate(savedInstanceState);
  14. setContentView(R.layout.activity_matrix);
  15. initViews();
  16. }
  17. private void initViews() {
  18. mImageView = (ImageView) findViewById(R.id.matrix_image_view);
  19. mSeekBarR = (SeekBar) findViewById(R.id.seek_bar_R);
  20. mSeekBarG = (SeekBar) findViewById(R.id.seek_bar_G);
  21. mSeekBarB = (SeekBar) findViewById(R.id.seek_bar_B);
  22. mSeekBarA = (SeekBar) findViewById(R.id.seek_bar_A);
  23. mSeekBarR.setOnSeekBarChangeListener(mOnSeekBarChangeListener);
  24. mSeekBarG.setOnSeekBarChangeListener(mOnSeekBarChangeListener);
  25. mSeekBarB.setOnSeekBarChangeListener(mOnSeekBarChangeListener);
  26. mSeekBarA.setOnSeekBarChangeListener(mOnSeekBarChangeListener);
  27. mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_import_contacts_black_24dp);
  28. // 获取一个与mBitmap大小一致的可编辑空图片。
  29. mAfterBitmap = Bitmap.createBitmap(
  30. mBitmap.getWidth(), mBitmap.getHeight(), mBitmap.getConfig());
  31. // 使用Bitmap对象创建Canvas,然后创建画笔。
  32. mCanvas = new Canvas(mAfterBitmap);
  33. mPaint = new Paint();
  34. mPaint.setAntiAlias(true);
  35. }
  36. private SeekBar.OnSeekBarChangeListener mOnSeekBarChangeListener
  37. = new SeekBar.OnSeekBarChangeListener() {
  38. @Override
  39. public void onStopTrackingTouch(SeekBar seekBar) {
  40. if (seekBar.getId() == R.id.seek_bar_A) {
  41. mImageView.getDrawable().setAlpha(mSeekBarA.getProgress());
  42. } else {
  43. float R = mSeekBarR.getProgress();
  44. float G = mSeekBarG.getProgress();
  45. float B = mSeekBarB.getProgress();
  46. // 根据SeekBar定义RGBA的矩阵, 通过修改矩阵第五列颜色的偏移量改变图片的颜色
  47. float[] src = new float[]{
  48. 1, 0, 0, 0, R,
  49. 0, 1, 0, 0, G,
  50. 0, 0, 1, 0, B,
  51. 0, 0, 0, 1, 0,
  52. };
  53. // 定义ColorMatrix,并指定RGBA矩阵
  54. ColorMatrix colorMatrix = new ColorMatrix();
  55. colorMatrix.set(src);
  56. // 使用ColorMatrix创建一个ColorMatrixColorFilter对象, 作为画笔的滤镜, 设置Paint的颜色
  57. mPaint.setColorFilter(new ColorMatrixColorFilter(src));
  58. // 通过指定了RGBA矩阵的Paint把原图画到空白图片上
  59. mCanvas.drawBitmap(mBitmap, new Matrix(), mPaint);
  60. mImageView.setImageBitmap(mAfterBitmap);
  61. }
  62. }
  63. @Override
  64. public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
  65. }
  66. @Override
  67. public void onStartTrackingTouch(SeekBar seekBar) {
  68. }
  69. };
  70. }

演示视频

它是一个浮动在当前界面上方并且可以显示在任意位置的View,PopupWindow应该有两点和弹出框不同,一是PopupWindow必须指定宽高属性,而弹出框则不是必须指定;二是PopupWindow必须指定其布局文件。

主要方法

ViewFlipper

常用属性
android:autoStart 设置自动加载下一个View
android:flipInterval 设置View之间切换的时间间隔
android:inAnimation 设置切换View的进入动画
android:outAnimation 设置切换View的退出动画
常用方法
isFlipping 判断View切换是否正在进行
setFilpInterval 设置View之间切换的时间间隔
startFlipping 开始View的切换,而且会循环进行
stopFlipping 停止View的切换
setOutAnimation 设置切换View的退出动画
setInAnimation 设置切换View的进入动画
showNext 显示ViewFlipper里的下一个View
showPrevious 显示ViewFlipper里的上一个View

一、主要布局

  1. <ViewFlipper
  2. android:id="@+id/view_flipper"
  3. android:layout_width="0dp"
  4. android:layout_height="160dp"
  5. android:layout_marginEnd="8dp"
  6. android:layout_marginLeft="8dp"
  7. android:background="#b9b1b1"
  8. android:layout_marginRight="8dp"
  9. android:layout_marginStart="8dp"
  10. android:autoStart="true"
  11. android:flipInterval="3000"
  12. android:inAnimation="@anim/anim_marquee_in"
  13. android:outAnimation="@anim/anim_marquee_out"
  14. app:layout_constraintLeft_toLeftOf="parent"
  15. app:layout_constraintRight_toRightOf="parent"
  16. tools:layout_editor_absoluteY="8dp">
  17. </ViewFlipper>

这里还涉及到两个动画其实就是一个平移的动画,它们都保存在anim文件夹中
anim_marquee_in.xml

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <set xmlns:android="http://schemas.android.com/apk/res/android">
  3. <translate
  4. android:duration="1500"
  5. android:fromYDelta="100%p"
  6. android:toYDelta="0"/>
  7. </set>

anim_marquee_out.xml

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <set xmlns:android="http://schemas.android.com/apk/res/android">
  3. <translate
  4. android:duration="1500"
  5. android:fromYDelta="0"
  6. android:toYDelta="-100%p"/>
  7. </set>

二、自定义样式

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <android.support.constraint.ConstraintLayout
  3. xmlns:android="http://schemas.android.com/apk/res/android"
  4. xmlns:app="http://schemas.android.com/apk/res-auto"
  5. xmlns:tools="http://schemas.android.com/tools"
  6. android:layout_width="match_parent"
  7. android:layout_height="match_parent">
  8. <ImageButton
  9. android:id="@+id/imageButton"
  10. android:layout_width="0dp"
  11. android:layout_height="140dp"
  12. android:layout_marginLeft="0dp"
  13. android:layout_marginRight="0dp"
  14. android:scaleType="centerCrop"
  15. app:layout_constraintHorizontal_bias="0.0"
  16. app:layout_constraintLeft_toLeftOf="parent"
  17. app:layout_constraintRight_toRightOf="parent"
  18. tools:layout_editor_absoluteY="2dp"/>
  19. <TextView
  20. android:id="@+id/textView"
  21. android:layout_width="wrap_content"
  22. android:layout_height="wrap_content"
  23. android:layout_marginLeft="8dp"
  24. android:layout_marginRight="8dp"
  25. android:layout_marginTop="0dp"
  26. app:layout_constraintLeft_toLeftOf="@+id/imageButton"
  27. app:layout_constraintRight_toRightOf="@+id/imageButton"
  28. app:layout_constraintTop_toBottomOf="@+id/imageButton"/>
  29. </android.support.constraint.ConstraintLayout>

Fragment

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注