Android开发-软件版本升级与黑暗模式的适配【Android 10】,android的基础ui组件

android:textStyle=“bold”

app:layout_constraintStart_toStartOf=“@+id/tv_text”

app:layout_constraintTop_toTopOf=“parent” />

<TextView

android:id=“@+id/tv_text”

android:layout_width=“190dp”

android:layout_height=“40dp”

android:layout_marginStart=“10dp”

android:layout_marginTop=“5dp”

android:gravity=“start”

android:text=“@string/tv_text”

android:textColor=“@color/colorUnitText”

android:textSize=“12sp”

app:layout_constraintStart_toEndOf=“@+id/iv_icon”

app:layout_constraintTop_toBottomOf=“@+id/tv_title” />

<TextView

android:id=“@+id/tv_time”

android:layout_width=“100dp”

android:layout_height=“15dp”

android:layout_marginEnd=“10dp”

android:layout_marginBottom=“20dp”

android:gravity=“end|center_vertical”

android:text=“@string/tv_time”

android:textSize=“12sp”

android:textStyle=“italic”

app:layout_constraintBottom_toBottomOf=“parent”

app:layout_constraintEnd_toEndOf=“parent” />

<ImageView

android:id=“@+id/iv_remove”

android:layout_width=“35dp”

android:layout_height=“35dp”

android:layout_marginEnd=“30dp”

android:layout_marginBottom=“10dp”

android:contentDescription=“@string/iv_remove”

app:layout_constraintBottom_toTopOf=“@+id/tv_time”

app:layout_constraintEnd_toEndOf=“parent”

app:srcCompat=“@drawable/icon_delete” />

<ImageView

android:id=“@+id/iv_icon”

android:layout_width=“60dp”

android:layout_height=“60dp”

android:layout_marginStart=“15dp”

android:layout_marginTop=“10dp”

android:contentDescription=“@string/iv_remove”

app:layout_constraintStart_toStartOf=“parent”

app:layout_constraintTop_toTopOf=“parent”

app:srcCompat=“@drawable/icon_notepad” />

<TextView

android:id=“@+id/tv_id”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:textColor=“#00FF0000”

app:layout_constraintStart_toStartOf=“parent”

app:layout_constraintTop_toTopOf=“parent” />

</androidx.constraintlayout.widget.ConstraintLayout>

activity_notepad.xml
<?xml version="1.0" encoding="utf-8"?>

<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=“match_parent”

android:layout_height=“match_parent”

android:fitsSystemWindows=“true”

tools:context=“.ActivityNotepad”>

<ScrollView

android:id=“@+id/sv”

android:layout_width=“match_parent”

android:layout_height=“match_parent”

android:background=“#FFFFFF”

app:layout_constraintBottom_toBottomOf=“parent”

app:layout_constraintEnd_toEndOf=“parent”

app:layout_constraintHorizontal_bias=“0.0”

app:layout_constraintStart_toStartOf=“parent”

app:layout_constraintTop_toTopOf=“parent”

app:layout_constraintVertical_bias=“0.0”>

<LinearLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:background=“@color/colorNotepadBackground”

android:orientation=“vertical”>

<EditText

android:id=“@+id/tv_title”

android:layout_width=“match_parent”

android:layout_height=“60dp”

android:layout_margin=“10dp”

android:autofillHints=“”

android:ems=“10”

android:fontFamily=“sans-serif-black”

android:gravity=“start”

android:hint=“@string/et_title_hint”

android:inputType=“textPersonName”

android:textColor=“@color/colorNotepadTitle”

android:textSize=“30sp” />

<com.example.notepad.MultilineTextEditWithUnderLine

android:id=“@+id/et_text”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_margin=“10dp”

android:background=“@null”

android:gravity=“start”

android:hint=“@string/et_text_hint”

android:letterSpacing=“0.03”

android:lineSpacingMultiplier=“1.5”

android:maxLines=“30”

android:minLines=“20”

android:textColor=“@color/colorNotepadText”

android:textSize=“18sp” />

</androidx.constraintlayout.widget.ConstraintLayout>

更改values/color.xml(白天模式)
<?xml version="1.0" encoding="utf-8"?>

#6200EE

#3700B3

#03DAC5

#CCCCFF

#000000

#111111

#FFFFFF

#000000

#111111

更改values-night/color.xml(黑夜模式)
<?xml version="1.0" encoding="utf-8"?>

#6200EE

#3700B3

#03DAC5

#555555

#FFFFFF

#EEEEEE

#777777

#FFFFFF

#EEEEEE

可以看出,AS默认的白天模式和在黑夜模式的手机上表现出了不一样的效果,这是系统自己适配的,图标的适配也一样,使用动态编码替换黑白两种图标,就能更加适配主题。

最后,在Java代码里来获取夜间模式的开启状态,便于我们动态做出更多选择。

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数初中级Android工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则近万的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年Android移动开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。

img

img

img

img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Android开发知识点,真正体系化!

由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!

如果你觉得这些内容对你有帮助,可以扫码获取!!(备注:Android)

面试复习路线,梳理知识,提升储备

自己的知识准备得怎么样,这直接决定了你能否顺利通过一面和二面,所以在面试前来一个知识梳理,看需不需要提升自己的知识储备是很有必要的。

关于知识梳理,这里再分享一下我面试这段时间的复习路线:(以下体系的复习资料是我从各路大佬收集整理好的)

  • 架构师筑基必备技能
  • Android高级UI与FrameWork源码
  • 360°全方面性能调优
  • 解读开源框架设计思想
  • NDK模块开发
  • 微信小程序
  • Hybrid 开发与Flutter

知识梳理完之后,就需要进行查漏补缺,所以针对这些知识点,我手头上也准备了不少的电子书和笔记,这些笔记将各个知识点进行了完美的总结:

Android开发七大模块核心知识笔记

《960全网最全Android开发笔记》

《379页Android开发面试宝典》

历时半年,我们整理了这份市面上最全面的安卓面试题解析大全
包含了腾讯、百度、小米、阿里、乐视、美团、58、猎豹、360、新浪、搜狐等一线互联网公司面试被问到的题目。熟悉本文中列出的知识点会大大增加通过前两轮技术面试的几率。

如何使用它?

1.可以通过目录索引直接翻看需要的知识点,查漏补缺。
2.五角星数表示面试问到的频率,代表重要推荐指数

《507页Android开发相关源码解析》

只要是程序员,不管是Java还是Android,如果不去阅读源码,只看API文档,那就只是停留于皮毛,这对我们知识体系的建立和完备以及实战技术的提升都是不利的。

真正最能锻炼能力的便是直接去阅读源码,不仅限于阅读各大系统源码,还包括各种优秀的开源库。

《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!

的题目。熟悉本文中列出的知识点会大大增加通过前两轮技术面试的几率。

如何使用它?

1.可以通过目录索引直接翻看需要的知识点,查漏补缺。
2.五角星数表示面试问到的频率,代表重要推荐指数

[外链图片转存中…(img-2K43ZarJ-1712423083718)]

《507页Android开发相关源码解析》

只要是程序员,不管是Java还是Android,如果不去阅读源码,只看API文档,那就只是停留于皮毛,这对我们知识体系的建立和完备以及实战技术的提升都是不利的。

真正最能锻炼能力的便是直接去阅读源码,不仅限于阅读各大系统源码,还包括各种优秀的开源库。

《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!

  • 3
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值