拨号通话
ListView
GridView
AdapterView


在路径android-sdkr16\android-sdkr16\platform-tools确认存在adb.exe
下载youlu_android_1_2_7.youlu.apk
运行cmd
d:
cd D:\0701\android0701\android-sdkr16\android-sdkr16\platform-tools
adb install youlu_android_1_2_7.youlu.apk
安装adb.exe


D:\0701\android0701\android-sdkr16\android-sdkr16\docs\reference\android\widget
可看android的参考文档

Adapter的4个方法
getCount
getView

getItem
getItemId

D:\0701\android0701\android-sdkr16\android-sdkr16\tools
点开draw9patch.bat
完成图像的自由拉伸
如:call_log_type_item_bg_a.9.png



常志鹏
18046501727
changzp@tarena.com.cn
QQ群:326285800

拨号通话:
现完成的是键盘的设置
--------------------------------------------------------------
PhoneManager.java
package cpm.tarena.Phone;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;

public class PhoneManagerActivity extends Activity {
 
//ImageButton mImagebutton_1,mImageButton_2,mImageButton_3,mImageButton_4,mImageButton_5,mImageButton_6,mImageButton_7,mImageButton_8,mImageButton_9,mImageButton_10,mImageButton_11,mImageButton_12;
 
ImageButton key_hide;
LinearLayout mLinearLayout;
 
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        mLinearLayout = (LinearLayout)findViewById(R.id.keyboard_layout);
        
        key_hide = (ImageButton) findViewById(R.id.key_hide);
        key_hide.setOnClickListener(new OnClickListener(){

@Override
public void onClick(View v) {
// TODO Auto-generated method stub
mLinearLayout.setVisibility(View.GONE);
}

        });   
    }
}

------------------------------------------------------------
main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >
 
    <LinearLayout
android:id="@+id/keyboard_layout"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"      
        android:orientation="vertical"
android:background="#fcfcfc">
        
       <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/keyboard_line_bg" >

            <ImageButton
                android:id="@+id/key_hide"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:background="#0000"
                android:src="@drawable/keyboard_hide" />

            <ImageButton
                android:id="@+id/key_del"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:background="#0000"
                android:src="@drawable/keyboard_backspace" />

            <Button
                android:id="@+id/call_button"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_toLeftOf="@id/key_del"
                android:layout_toRightOf="@id/key_hide"
                android:background="@drawable/dial_call_bg"
                android:text="139111111"
                android:textSize="18sp"
                android:textColor="#fff"
                android:ellipsize="start" />
        </RelativeLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >

            <ImageButton
                android:id="@+id/key_1"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_1"
                android:background="@drawable/key_bg_s"/>

            <ImageButton
android:id="@+id/key_2"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_2"
                android:background="@drawable/key_bg_s"/>

            <ImageButton
                android:id="@+id/key_3"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_3"
                android:background="@drawable/key_bg_s"/>
        </LinearLayout>
        
         <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >

            <ImageButton
                android:id="@+id/key_4"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_4"
                android:background="@drawable/key_bg_s"/>

            <ImageButton
                android:id="@+id/key_5"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_5"
                android:background="@drawable/key_bg_s"/>

            <ImageButton
                android:id="@+id/key_6"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_6"
               android:background="@drawable/key_bg_s"/>
        </LinearLayout>
        
          <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >

            <ImageButton
                android:id="@+id/key_7"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_7"
                android:background="@drawable/key_bg_s"/>

            <ImageButton
                android:id="@+id/key_8"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_8"
                android:background="@drawable/key_bg_s"/>

            <ImageButton
                android:id="@+id/key_9"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_9"
                android:background="@drawable/key_bg_s"/>
        </LinearLayout>
        
        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >       

            <ImageButton
                android:id="@+id/key_jin"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_hash"
                android:background="@drawable/key_bg_s"/>
            
             <ImageButton
                 android:id="@+id/key_0"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_0"
                android:background="@drawable/key_bg_s"/>

            <ImageButton
                android:id="@+id/key_xin"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/keyboard_star"
                android:background="@drawable/key_bg_s"/>
        </LinearLayout>
         
    </LinearLayout>

</RelativeLayout>


-----------------------------------------------------
在res下新建文件夹drawable
在该文件下,新建selector
命名key_bg_s
(实现按键时,改变按键的颜色)
实现方法为设置背景时,设置为key_bg_s
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
        <item 
       android:drawable="@drawable/key_bg_a"
       android:state_pressed="true"/>        
        <item
            android:drawable="@drawable/key_bg"/>
</selector>


注意:严格的要求在上面
实现的效果为:

最新文章

  1. C#进阶系列——WebApi 异常处理解决方案
  2. 数据分析(8):Series介绍
  3. 创建style和修改style
  4. QML开源游戏
  5. 对比Windows 8模拟器(Simulator)和Windows Phone仿真器(Emulator)
  6. POJ 3264 RMQ裸题
  7. 功能强大的js数组方法:reduce
  8. if语句的嵌套以及条件运算符和条件表达式(初学者)
  9. Luogu4609 FJOI2016建筑师(斯特林数)
  10. [Python] 02 - String
  11. InstallShield安装包在Win7下权限问题的解决方案 (转载)
  12. s5-11 距离矢量路由选择协议
  13. jQuery UI的datepicker()与变更格式
  14. go反射的规则
  15. OGG日常运维监控的自动化脚本模板
  16. python ddt 实现数据驱动一
  17. sql排序方法
  18. Wahrscheinlichkeitstheorie und mathematische Statistik
  19. vs中: 错误,未定义的标识符getline 的解决方法
  20. 一个免费的API-手机号码归属地接口

热门文章

  1. sql点滴37—mysql中的错误Data too long for column &#39;&#39; at row 1
  2. WebApi 插件式构建方案
  3. Extjs 组件继承 模板说明(同GridPanel案件)
  4. 依据道路的shape获得high_cross和low_cross
  5. 读书笔记—CLR via C#章节11-13
  6. php中session和cookie
  7. Confluence, JIRA, Fisheye
  8. JS代码平面化
  9. Easyui布局
  10. 自定义表单-jsonform