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 ...
随机推荐
- 从零开始利用vue-cli搭建简单音乐网站(五)
上一篇文章讲到的是如何利用mongoose从数据库读取数据然后更新页面,接下来要实现的就是用户注册登录功能,这个功能涉及到的东西太多了,今天只实现了登录功能,登陆之后更新导航条界面,最后效果如下: 登 ...
- 当ThreadLocal碰上线程池
ThreadLocal使用 ThreadLocal可以让线程拥有本地变量,在web环境中,为了方便代码解耦,我们通常用它来保存上下文信息,然后用一个util类提供访问入口,从controller层到s ...
- 洛谷 P1309 瑞士轮
题目背景 在双人对决的竞技性比赛,如乒乓球.羽毛球.国际象棋中,最常见的赛制是淘汰赛和循环赛.前者的特点是比赛场数少,每场都紧张刺激,但偶然性较高.后者的特点是较为公平,偶然性较低,但比赛过程往往十分 ...
- Openjudge 1.13-21:最大质因子序列
总时间限制: 1000ms 内存限制: 65536kB 描述 任意输入两个正整数m, n (1 < m < n <= 5000),依次输出m到n之间每个数的最大质因子(包括m和n ...
- Codeforces Gym 100650B Countdown (离线)
题目链接:http://codeforces.com/gym/100650 根据给出的树和d,求出一些结点,这些结点形成子树的第d层结点数应该尽量多,具体要求可以参考题目. dfs一个结点前保存询问深 ...
- poj1142Smith Numbers质因子分解
题意:一个数不是质数,其质因子的每位加起来等于该数的每位加起来. /* 题意:一个数的所有质因子的每位相加起来等于该数的每位相加起来且该数不能是质数,那么就是史密斯数 tip:对于分解质因子,只需要判 ...
- @ConditionalOnProperty来控制Configuration是否生效
1. 简介 Spring Boot通过@ConditionalOnProperty来控制Configuration是否生效 2. 说明 @Retention(RetentionPolicy.RUNTI ...
- Python协程函数
1 协程函数 1.1 协程函数理解 协程函数就是使用了yield表达式形式的生成器 def eater(name): print("%s eat food" %name) whil ...
- python基础面试题整理---从零开始 每天十题(01)
最近在弄flask的东西,好久没写博客的,感觉少了点什么,感觉被别人落下好多,可能渐渐的养成了写博客的习惯吧.也是自己想学的东西太多了(说白了就是基础太差了,只是know how,不能做到konw w ...
- Cscope的使用(领略Vim + Cscope的强大魅力)
文章出处:http://blog.csdn.net/dengxiayehu/article/details/6330200 Cscope的使用(领略Vim + Cscope的强大魅力) 1.Cscop ...