Title共通写法
用:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/background_shadow"> <jp.co.gunmabank.view.AccountAppTitleLayout
android:id="@+id/title_talk"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="10dip"></jp.co.gunmabank.view.AccountAppTitleLayout> </LinearLayout> xml文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/color_account_title_bg"
android:id="@+id/open_set_title_background"
android:orientation="vertical"> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"> <ImageView
android:id="@+id/open_account_title_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/back_btn"
android:gravity="center" /> <TextView
android:id="@+id/open_account_title_name"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:textSize="15sp" /> <Button
android:id="@+id/testDb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="DBtest" /> <TextView
android:id="@+id/open_account_close"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginRight="5dp"
android:gravity="center"
android:text="中断する"
android:textSize="13sp" />
</LinearLayout> </LinearLayout> 类:
package jp.co.view
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.view.inputmethod.InputMethodManager
import android.widget.Button
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView //アプリのタイトル
class AccountAppTitleLayout(context: Context, attrs: AttributeSet) : LinearLayout(context, attrs) {
init {
//充填画面
LayoutInflater.from(context).inflate(R.layout.open_account_title_layout, this)
//活動
val activity = (getContext() as Activity)
//backキー
val titleBack = findViewById(R.id.open_account_title_back) as ImageView
titleBack.setOnClickListener {
Common.closeKeyboard(activity, titleBack)
activity.finish()
}
//中断する
val openAccountClose = findViewById(R.id.open_account_close) as TextView
openAccountClose.setOnClickListener {
//ダイアログ
val confirmDialog = CloseConfirmDialog(activity, "お申込みの手続きを中断してポータル画面に戻りますか?", "", "はい", "いいえ", true)
//ダイアログ
confirmDialog.setClicklistener(object : CloseConfirmDialog.ClickListenerInterface {
//はい
override fun doConfirm() {
//MainTab画面遷移
var intent = Intent(activity, MainTabActivity::class.java);
activity.startActivity(intent)
ActivityCollector.accountFinishAll()
confirmDialog.dismiss()
} //いいえ
override fun doCancel() {
confirmDialog.dismiss()
}
})
confirmDialog.show()
} }
}
Title共通写法的更多相关文章
- Dialog共通写法(两个button)
package jp.co.hyakujushibank.view import android.app.Dialogimport android.content.Contextimport andr ...
- Dialog共通写法(一个button)
一个button的: package jp.co.hyakujushibank.view import android.app.Dialogimport android.content.Context ...
- Android请求网络共通类——Hi_博客 Android App 开发笔记
今天 ,来分享一下 ,一个博客App的开发过程,以前也没开发过这种类型App 的经验,求大神们轻点喷. 首先我们要创建一个Andriod 项目 因为要从网络请求数据所以我们先来一个请求网络的共通类. ...
- 一个共通的viewModel搞定所有的编辑页面-经典ERP录入页面(easyui + knockoutjs + mvc4.0)
http://www.cnblogs.com/xqin/archive/2013/06/06/3120887.html 前言 我写代码喜欢提取一些共通的东西出来,之前的一篇博客中说了如何用一个共通的v ...
- 一个共通的viewModel搞定所有的分页查询一览及数据导出(easyui + knockoutjs + mvc4.0)
前言 大家看标题就明白了我想写什么了,在做企业信息化系统中可能大家写的最多的一种页面就是查询页面了.其实每个查询页面,除了条件不太一样,数据不太一样,其它的其实都差不多.所以我就想提取一些共通的东西出 ...
- 共通css初次尝试
1.网页的主要的html <@fn.html css=["${basePath}/css/help/guideCommon.css${versionControl}"]tit ...
- 共通脚本utils
/** * 模块名:共通脚本 * 程序名: 通用工具函数 **/ var utils = {}; /** * 格式化字符串 * 用法: .formatString("{0}-{1}" ...
- List排序共通代码
此共通方法可以根据特定字段进行排序 package com.gomecar.index.common.utils; import java.lang.reflect.Method; import ja ...
- C#验证对象中的属性是否为空的共通方法
在后台接口处理时,经常需要对请求的参数做验证.因此提取了共通方法,方便进行判断. /// <summary> /// 数据验证工具类 /// </summary> public ...
随机推荐
- ubuntu 14.04 安装tomcat服务器 配置图片路径和文件路径
root@hett-PowerEdge-T30:/usr/local/src# lltotal 235956drwxr-xr-x 6 root root 4096 3月 26 14:48 ...
- ubuntu 14.04 安装mysql,并配置远程连接和中文乱码
1. 安装MySQL的jar root@computer-PowerEdge-T30:~# sudo apt-get install mysql-server mysql-client在本次安装中,根 ...
- eclipse报错MA
今天有个总监晒了张tomcat7.0崩溃忘记怎么搞了,大家都在吐槽"一个[总监](经常水群)竟然不会这个".敲上来. Problem Occurred系列: 'Starting T ...
- 机器学习之-奇异值分解(SVD)原理详解及推导
转载 http://blog.csdn.net/zhongkejingwang/article/details/43053513 在网上看到有很多文章介绍SVD的,讲的也都不错,但是感觉还是有需要补充 ...
- Python3 try-except、raise和assert解析
Python3 try-except.raise和assert解析 一.说明 关于异常捕获try-except:在学java的时候就被教育异常捕获也是java相对c的一大优点,几年下来多少也写了些代码 ...
- 关于Java IO流学习总结
一.IO流的三种分类方式 1.按流的方向分为:输入流和输出流 2.按流的数据单位不同分为:字节流和字符流 3.按流的功能不同分为:节点流和处理流 二.IO流的四大抽象类: 字符流:Reader ...
- Ukulele 原来你也在这里
- Swift 中 String 与 CChar 数组的转换
在现阶段Swift的编码中,我们还是有很多场景需要调用一些C函数.在Swift与C的混编中,经常遇到的一个问题就是需要在两者中互相转换字符串.在C语言中,字符串通常是用一个char数组来表示,在Swi ...
- 268. Missing Number@python
Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missin ...
- 【数论 dp】2048
考场上一个DFS优化乱加就对了一个无解的点 题目描述 给定一个长度为 n 的数列,在这个数列中选取一个子序列使得这个子序列中的数能合出2048 对于合并操作,可以选择这个序列中的任意两个数进行合并,当 ...