内容简介:执行逻辑
布局 activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp"
tools:ignore="ContentDescription,HardcodedText,UselessParent">
<LinearLayout
android:id="@+id/screenshotLayout"
android:layout_width="310dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginEnd="25dp"
android:layout_marginStart="25dp"
android:layout_marginTop="25dp"
android:background="@drawable/bg_qr_code"
android:orientation="vertical">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="17dp">
<ImageView
android:id="@+id/iv_avatar"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:src="@drawable/qq" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_toEndOf="@id/iv_avatar"
android:text="QQ"
android:textColor="#000000"
android:textSize="18sp" />
<TextView
android:id="@+id/tv_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@id/tv_name"
android:layout_below="@id/tv_name"
android:text="好友"
android:textColor="#9b9b9b"
android:textSize="14sp" />
</RelativeLayout>
<ImageView
android:layout_width="250dp"
android:layout_height="250dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="24dp"
android:src="@drawable/generate" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="27dp"
android:layout_marginTop="23dp"
android:text="扫一扫加为好友"
android:textColor="#6c6b6e"
android:textSize="12sp"
tools:ignore="HardcodedText" />
</LinearLayout>
</FrameLayout>
执行逻辑
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
screenshotLayout.setOnClickListener { screenShot() }
}
private fun screenShot() {
screenshotLayout.isDrawingCacheEnabled = true
val bitmap = screenshotLayout.getDrawingCache(false)
screenshotLayout.destroyDrawingCache()
bitmap.toString() // Bitmap to save.
}
}
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:- 前端字体截取:实战篇
- 前端字体截取
- Apache Pig字符串截取实战小例子
- Apache Pig字符串截取实战小例子
- Apache Pig字符串截取实战小例子
- 用 puppeteer 实现网站自动分页截取的趣事
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
算法交易与套利交易
赵胜民 / 厦门大学出版社 / 2010-9 / 35.00元
《算法交易与套利交易》主要介绍算法交易和一些套利交易的策略,以便于读者对相关方面的内容进行阅读和学习。在《算法交易与套利交易》的第一部分,我们回顾了投资学一些相关的基本内容。其中,前两章介绍了证券投资的收益和风险等特征,以及马可维茨的最优资产配置模型。第3章则介绍了股票投资分析当中常用的资本资产定价模型(CAPM)、套利定价模型(APT),以及因素模型。然后,第4、5章分别讲到了金融证券估值模型、......一起来看看 《算法交易与套利交易》 这本书的介绍吧!