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 ...
随机推荐
- Android:Service通知Activity更新界面
Android有四大组件,其中包括service和activity,那么在使用的过程中,我们最常遇到的问题是他们之间的通信问题. 1.首先Activity调用Service 这个是比较基础的,它有两种 ...
- 【extjs6学习笔记】0.0 准备
1.下载ExtJS 6 下面是Ext JS 6正式版的GPL版本下载地址 https://www.sencha.com/legal/gpl/ 2.下载sencha cmd 安装完成后,命令行运行出现以 ...
- Jenkins在Windows上部署
下载解压安装即可.(注意:不要安装在系统盘) 下载地址:http://mirrors.jenkins-ci.org/war-stable/(官方镜像地址) 去相应目录复制管理员密码粘贴到输入框 选择安 ...
- /etc/default/useradd
系统默认的shell在,/etc/default/useradd 中,添加用户的时候如果不指定shell,默认的shell就是该文件下制定的文件
- 爬虫基本原理及requests,response详解
一.爬虫基本原理 1.爬虫是什么 #1.什么是互联网? 互联网是由网络设备(网线,路由器,交换机,防火墙等等)和一台台计算机连接而成,像一张网一样. #2.互联网建立的目的? 互联网的核心价值在于数据 ...
- JAVASCRIPT闭包以及原型链
方法内部还有个方法,实例化父方法后,再次调用父方法,可以运行父方法内部的子方法,这样的程序就叫做闭包 DEMO如下: //function outerFn() { // var outerVar = ...
- ios项目icon和default图片命名规则
一.应用图片标准iOS控件里的图片资源,苹果已经做了相应的升级,我们需要操心的是应用自己的图片资源.就像当初为了支持iPhone 4而制作的@2x高分辨率版本(译者:以下简称高分)图片一样,我们要为i ...
- C#背景图片自适应
1.选中窗体修改属性 2.在load添加代码 private void Form1_Load(object sender, EventArgs e) { this.BackgroundImageLay ...
- 674. Longest Continuous Increasing Subsequence@python
Given an unsorted array of integers, find the length of longest continuous increasing subsequence (s ...
- Xshell 配色方案 Ubuntu Solarized_Dark isayme
前言 最近在用Ubuntu,发现它的配色方案挺好看的,所以查了下有没有大神做过Xshell的Ubuntu配色方案. 一看,果然还是有大佬做了这个的. 三套配色配置如下: 1. Ubuntu的Solar ...