用:

<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共通写法的更多相关文章

  1. Dialog共通写法(两个button)

    package jp.co.hyakujushibank.view import android.app.Dialogimport android.content.Contextimport andr ...

  2. Dialog共通写法(一个button)

    一个button的: package jp.co.hyakujushibank.view import android.app.Dialogimport android.content.Context ...

  3. Android请求网络共通类——Hi_博客 Android App 开发笔记

    今天 ,来分享一下 ,一个博客App的开发过程,以前也没开发过这种类型App 的经验,求大神们轻点喷. 首先我们要创建一个Andriod 项目 因为要从网络请求数据所以我们先来一个请求网络的共通类. ...

  4. 一个共通的viewModel搞定所有的编辑页面-经典ERP录入页面(easyui + knockoutjs + mvc4.0)

    http://www.cnblogs.com/xqin/archive/2013/06/06/3120887.html 前言 我写代码喜欢提取一些共通的东西出来,之前的一篇博客中说了如何用一个共通的v ...

  5. 一个共通的viewModel搞定所有的分页查询一览及数据导出(easyui + knockoutjs + mvc4.0)

    前言 大家看标题就明白了我想写什么了,在做企业信息化系统中可能大家写的最多的一种页面就是查询页面了.其实每个查询页面,除了条件不太一样,数据不太一样,其它的其实都差不多.所以我就想提取一些共通的东西出 ...

  6. 共通css初次尝试

    1.网页的主要的html <@fn.html css=["${basePath}/css/help/guideCommon.css${versionControl}"]tit ...

  7. 共通脚本utils

    /** * 模块名:共通脚本 * 程序名: 通用工具函数 **/ var utils = {}; /** * 格式化字符串 * 用法: .formatString("{0}-{1}" ...

  8. List排序共通代码

    此共通方法可以根据特定字段进行排序 package com.gomecar.index.common.utils; import java.lang.reflect.Method; import ja ...

  9. C#验证对象中的属性是否为空的共通方法

    在后台接口处理时,经常需要对请求的参数做验证.因此提取了共通方法,方便进行判断. /// <summary> /// 数据验证工具类 /// </summary> public ...

随机推荐

  1. let和const注意点

    let 一.块级作用域 下面的代码如果使用var,最后输出的是10. var a = []; for (var i = 0; i < 10; i++) { a[i] = function () ...

  2. Wrapper class package.jaxws.methodName is not found. Have you run APT to generate them?解决方案

    使用JAX-WS 2.X基于Web容器发布WebService报错,错误信息类似于: Wrapper class package.jaxws.methodName is not found. Have ...

  3. Hadoop2.6.2的Eclipse插件的使用

    欢迎转载,且请注明出处,在文章页面明显位置给出原文连接. 本文链接:http://www.cnblogs.com/zdfjf/p/5178197.html 首先给出eclipse插件的下载地址:htt ...

  4. window服务的使用

    目前的项目中使用很多服务来进行实现.服务是依靠windows操作系统来实现.可以是定时器类型,比如定时执行费时的任务,这种任务时最多.也可以是一些服务(SOAP)的宿主,不在限制与iis,不现在限制于 ...

  5. MySQL常用命令和语句

    1.常用SQL语句 1)常用函数/*type可取值为:MICROSECONDSECONDMINUTEHOURDAYWEEKMONTHQUARTERYEARSECOND_MICROSECONDMINUT ...

  6. .NET 通过 NPOI 操作 Excel

    目录 .NET 通过 NPOI 操作 Excel 第一步:通过 NuGet 获取 NPOI 包并引入程序集 第二步:引入 NPOI 帮助类 第三步:在程序中调用相应的方法对数据进行导出导入操作 将 D ...

  7. 文字自动自左向右滚动的js代码

    重要的一点,就是scrollLeft一直在变化.对象一直在移动,参照物没有动. 代码: css: #div1{display:black;width:110px;height:50px;line-he ...

  8. JS计算两个日期时间差,天 小时 分 秒格式

    function diffTime(startDate,endDate) { startDate= new Date(startDate); endDate = new Date(endDate); ...

  9. 二分查找 && 三分查找

    LeetCode34. Find First and Last Position of Element in Sorted Array 题意:找出指定元素出现的范围,Ologn 思路:两次二分 cla ...

  10. Bootstrap select(选择列表)

    当您想让用户从多个选项中进行选择,但是默认情况下只能选择一个选项,则使用选择框 1.使用<select>展示列表选项 2.使用multiple="multiple"允许 ...