android开发ToolBar详细解说

1. 概述

Android 3.0 Android 推了 ActionBar 这个控件,而到了2013 年 Google 开始大力地推动所谓的 android style,想要逐渐改善过去 android 纷乱的界面设计,希望让终端使用者尽可能在 android 手机有个一致的操作体验。ActionBar 过去最多人使用的两大套件就是 ActionBarSherlock 以及官方提供在 support library v 7 里的 AppCompat。

既然会有本篇跟各位介绍的 Toolbar,也意味着官方在某些程度上认为 ActionBar 限制了 android app 的开发与设计的弹性,而在 material design 也对之做了名称的定义:App bar。接下来将为各位分成几个阶段进行说明,如何在 android app 中用 toolbar 这个控件来做出一个基本的 app bar 喽。

本篇所使用到的程序请到 Github 取得。

PromptDialog、AlertDialog演示类

使用菜单触发:

switch (id){
case R.id.action0:
Log.i(TAG,”Action0″);
FragmentTransaction ftrn = getFragmentManager().beginTransaction();
AlertDialog ad = new AlertDialog().newInstense(“Alert信息:”,”恭喜您中奖了!”,1);
ad.show(ftrn,TAG);

break;
case R.id.action1:
Log.i(TAG,”Action1″);
FragmentTransaction ft = getFragmentManager().beginTransaction();
PromptDialog pd = new PromptDialog().newInstense(“请输入新的手机号码:”,”例如:13300018888″);
pd.show(ft,TAG);
break;
case R.id.action2:
Log.i(TAG, “Action2″);
Toast.makeText(MainActivity.this,”Toast信息框”,Toast.LENGTH_LONG).show();
break;
default:
Log.i(TAG,”Nothing”);
break;
}

安卓消息通知类Notification、NotificationManager

class NotifyEx {
private Notification notify;
private Context mContext;
private NotificationManager Nm;
private Intent intent;
private static int NOTIFITY_ID = 0x123;
private static final String TAG = “NotifyEx”;
private static int count = 1;

public NotifyEx(Context c){
mContext = c;
Nm = (NotificationManager)c.getSystemService(Context.NOTIFICATION_SERVICE);
}

联想M7650加粉后重置/清零的方法

加粉后,没有找到墨盒上清零的纽扣,上网一查,才发现只要设置下就可以清零了。

1.打开前盖;

2.按清除键,面板显示“是否更换硒鼓”;

3.按开始键,此时面板没有任何显示;

4.直接输入数字“11”;

5.按确认键,关闭前盖,操作完成。

 

17071727374118
 
Copyright © 2008-2021 lanxinbase.com Rights Reserved. | 粤ICP备14086738号-3 |