- 浏览: 367332 次
- 性别:
- 来自: 福州
文章分类
最新评论
-
loveskey:
找了好久,可算是找到了。感谢
dx.jar dx.bat -
zhaoyi168:
可以把工程的代码发给我吗?
ZJLN1982@yahoo.co ...
Athrun Demo -
ergodic09:
請問樓主 我目前在porting AR6003但是無法自己產生 ...
009-Android平台开发-WIFI function porting-WIFI功能移植 -
iedj99fei:
...
androi中xliff:g
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="@string/hello"
/>
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_marginTop="20dip">
<RelativeLayout android:id="@+id/up"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentTop="true" android:gravity="center">
<com.android.customview.CustomToggleButton
android:id="@+id/toggle_button_1" android:layout_alignParentTop="true"
android:layout_alignParentLeft="true" android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<com.android.customview.CustomToggleButton
android:id="@+id/toggle_button_2" android:layout_alignParentTop="true"
android:layout_marginLeft="10dip" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_toRightOf="@+id/toggle_button_1" />
<com.android.customview.CustomToggleButton
android:id="@+id/toggle_button_3" android:layout_alignParentTop="true"
android:layout_marginLeft="10dip" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_toRightOf="@+id/toggle_button_2" />
</RelativeLayout>
<RelativeLayout android:id="@+id/down"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dip" android:gravity="center"
android:layout_below="@+id/up">
<com.android.customview.CustomToggleButton
android:id="@+id/toggle_button_4" android:layout_alignParentTop="true"
android:layout_alignParentLeft="true" android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<com.android.customview.CustomToggleButton
android:id="@+id/toggle_button_5" android:layout_alignParentTop="true"
android:layout_marginLeft="10dip" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_toRightOf="@+id/toggle_button_4" />
<com.android.customview.CustomToggleButton
android:id="@+id/toggle_button_6" android:layout_alignParentTop="true"
android:layout_marginLeft="10dip" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_toRightOf="@+id/toggle_button_5" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
custom_toggle_button.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="80dip" android:layout_marginTop="0dip"
android:layout_height="46dip" android:background="@+drawable/button_bg_normal"
android:id="@+id/custom_toggle_button" android:orientation="vertical" >
<TextView android:id="@+id/toggle_button_text" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_marginTop="50dip"
android:textColor="@+color/red" android:layout_marginLeft="20dip" />
<ImageView android:id="@+id/toggle_button_lightbar" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_below="@+id/toggle_button_text"
android:layout_marginTop="10dip" android:src="@+drawable/llightbar_off"
android:layout_marginLeft="5dip" />
</LinearLayout>
CustomView.java
package com.android.customview;
import java.util.ArrayList;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
public class CustomView extends Activity implements OnClickListener {
private CustomToggleButton mToggleButton1;
private CustomToggleButton mToggleButton2;
private CustomToggleButton mToggleButton3;
private CustomToggleButton mToggleButton4;
private CustomToggleButton mToggleButton5;
private CustomToggleButton mToggleButton6;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mToggleButton1 = (CustomToggleButton)findViewById(R.id.toggle_button_1);
mToggleButton1.setText("Button1");
mToggleButton1.setOnClickListener(this);
mToggleButton2 = (CustomToggleButton)findViewById(R.id.toggle_button_2);
mToggleButton2.setText("Button2");
mToggleButton2.setOnClickListener(this);
mToggleButton3 = (CustomToggleButton)findViewById(R.id.toggle_button_3);
mToggleButton3.setText("Button3");
mToggleButton3.setOnClickListener(this);
mToggleButton4 = (CustomToggleButton)findViewById(R.id.toggle_button_4);
mToggleButton4.setText("Button4");
mToggleButton4.setOnClickListener(this);
mToggleButton5 = (CustomToggleButton)findViewById(R.id.toggle_button_5);
mToggleButton5.setText("Button5");
mToggleButton5.setOnClickListener(this);
mToggleButton6 = (CustomToggleButton)findViewById(R.id.toggle_button_6);
mToggleButton6.setText("Button6");
mToggleButton6.setOnClickListener(this);
addTrackballItems();
}
@Override
public void onClick(View v) {
int resId = v.getId();
handleButtonEvent(resId);
}
private void handleButtonEvent(int resId){
switch (resId){
case R.id.toggle_button_1:
mToggleButton1.setChecked(true);
Intent intent = new Intent();
intent.setClass(this, TestBringToFront.class);
startActivity(intent);
break;
case R.id.toggle_button_2:
mToggleButton2.setChecked(true);
break;
case R.id.toggle_button_3:
mToggleButton3.setChecked(true);
break;
case R.id.toggle_button_4:
mToggleButton4.setChecked(true);
break;
case R.id.toggle_button_5:
mToggleButton5.setChecked(true);
break;
case R.id.toggle_button_6:
mToggleButton6.setChecked(true);
break;
}
}
private int convertIndexToResId(int curIndex){
if (curIndex == 0){
return R.id.toggle_button_1;
}else if (curIndex == 1){
return R.id.toggle_button_2;
}else if (curIndex == 2){
return R.id.toggle_button_3;
}else if (curIndex == 3){
return R.id.toggle_button_4;
}else if (curIndex == 4){
return R.id.toggle_button_5;
}else {
return R.id.toggle_button_6;
}
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode){
case KeyEvent.KEYCODE_DPAD_UP:
searchUpFocus();
break;
case KeyEvent.KEYCODE_DPAD_DOWN:
searchDownFocus();
break;
case KeyEvent.KEYCODE_DPAD_RIGHT:
searchRightFocus();
break;
case KeyEvent.KEYCODE_DPAD_LEFT:
searchLeftFocus();
break;
case KeyEvent.KEYCODE_DPAD_CENTER:
handleButtonEvent(convertIndexToResId(mCurTrackballIndex));
break;
}
return super.onKeyDown(keyCode, event);
}
private ArrayList<View> mTrackballItems = new ArrayList<View>();
private int mCurTrackballIndex = 0;
private int mTrackballItemsCount = 0;
private void addTrackballItems(){
mTrackballItems.add(mToggleButton1); // index = 0
mTrackballItems.add(mToggleButton2); // index = 1
mTrackballItems.add(mToggleButton3); // index = 2
mTrackballItems.add(mToggleButton4); // index = 3
mTrackballItems.add(mToggleButton5); // index = 4
mTrackballItems.add(mToggleButton6); // index = 5
mTrackballItemsCount = mTrackballItems.size();
}
private void searchUpFocus(){
if (mTrackballItems.get(mCurTrackballIndex).isSelected()){
if (mCurTrackballIndex - 3 >= 0){
mTrackballItems.get(mCurTrackballIndex).setSelected(false);
mCurTrackballIndex = mCurTrackballIndex - 3;
}else {
return;
}
}else {
mCurTrackballIndex = 0;
}
mTrackballItems.get(mCurTrackballIndex).setSelected(true);
setCurFocus(mCurTrackballIndex);
}
private void searchDownFocus(){
if (mTrackballItems.get(mCurTrackballIndex).isSelected()){
if (mCurTrackballIndex - 3 < 0){
mTrackballItems.get(mCurTrackballIndex).setSelected(false);
mCurTrackballIndex = mCurTrackballIndex + 3;
}else {
return;
}
}else {
mCurTrackballIndex = 0;
}
mTrackballItems.get(mCurTrackballIndex).setSelected(true);
setCurFocus(mCurTrackballIndex);
}
private void searchRightFocus(){
boolean isVaildUpRow = (mCurTrackballIndex >= 0) && (mCurTrackballIndex < 3);
boolean isVaildDownRow = (mCurTrackballIndex >= 3) && (mCurTrackballIndex < 5);
if (mTrackballItems.get(mCurTrackballIndex).isSelected()){
if (isVaildUpRow || isVaildDownRow){
mTrackballItems.get(mCurTrackballIndex).setSelected(false);
mCurTrackballIndex = mCurTrackballIndex + 1;
}else {
return;
}
}else {
mCurTrackballIndex = 0;
}
mTrackballItems.get(mCurTrackballIndex).setSelected(true);
setCurFocus(mCurTrackballIndex);
}
private void searchLeftFocus(){
boolean isVaildUpRow = (mCurTrackballIndex > 0) && (mCurTrackballIndex <= 3);
boolean isVaildDownRow = (mCurTrackballIndex > 3) && (mCurTrackballIndex <= 5);
if (mTrackballItems.get(mCurTrackballIndex).isSelected()){
if (isVaildUpRow || isVaildDownRow){
mTrackballItems.get(mCurTrackballIndex).setSelected(false);
mCurTrackballIndex = mCurTrackballIndex - 1;
}else {
return;
}
}else {
mCurTrackballIndex = 0;
}
mTrackballItems.get(mCurTrackballIndex).setSelected(true);
setCurFocus(mCurTrackballIndex);
}
private void setCurFocus(int curIndex){
clearAllFocus();
((CustomToggleButton)mTrackballItems.get(curIndex)).setBgFocus();
}
private void clearAllFocus(){
for (int i = 0; i < mTrackballItemsCount; i++){
((CustomToggleButton)mTrackballItems.get(i)).clearBgFocus();
}
}
}
CustomToggleButton.java
package com.android.customview;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
public class CustomToggleButton extends LinearLayout{
private Context mContext;
private LinearLayout mCustomToggleButton;
private TextView mText;
private ImageView mLightbar;
public CustomToggleButton(Context context) {
super(context);
mContext = context;
initView();
}
public CustomToggleButton(Context context, AttributeSet attrs) {
super(context, attrs);
mContext = context;
initView();
}
private void initView(){
LinearLayout l = (LinearLayout)View.inflate(mContext, R.layout.custom_toggle_button, null);
addView(l);
mCustomToggleButton = (LinearLayout)findViewById(R.id.custom_toggle_button);
// mCustomToggleButton.setOnClickListener(this);
mText = (TextView)findViewById(R.id.toggle_button_text);
mLightbar = (ImageView)findViewById(R.id.toggle_button_lightbar);
}
public void setText(String text){
mText.setText(text);
}
public void setChecked(boolean isChecked){
if (isChecked){
mLightbar.setImageResource(R.drawable.lightbar_on);
}else {
mLightbar.setImageResource(R.drawable.lightbar_off);
}
}
public void setBgFocus(){
mCustomToggleButton.setBackgroundResource(R.drawable.button_bg_focus);
}
public void clearBgFocus(){
mCustomToggleButton.setBackgroundResource(R.drawable.button_bg_normal);
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="@string/hello"
/>
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_marginTop="20dip">
<RelativeLayout android:id="@+id/up"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentTop="true" android:gravity="center">
<com.android.customview.CustomToggleButton
android:id="@+id/toggle_button_1" android:layout_alignParentTop="true"
android:layout_alignParentLeft="true" android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<com.android.customview.CustomToggleButton
android:id="@+id/toggle_button_2" android:layout_alignParentTop="true"
android:layout_marginLeft="10dip" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_toRightOf="@+id/toggle_button_1" />
<com.android.customview.CustomToggleButton
android:id="@+id/toggle_button_3" android:layout_alignParentTop="true"
android:layout_marginLeft="10dip" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_toRightOf="@+id/toggle_button_2" />
</RelativeLayout>
<RelativeLayout android:id="@+id/down"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dip" android:gravity="center"
android:layout_below="@+id/up">
<com.android.customview.CustomToggleButton
android:id="@+id/toggle_button_4" android:layout_alignParentTop="true"
android:layout_alignParentLeft="true" android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<com.android.customview.CustomToggleButton
android:id="@+id/toggle_button_5" android:layout_alignParentTop="true"
android:layout_marginLeft="10dip" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_toRightOf="@+id/toggle_button_4" />
<com.android.customview.CustomToggleButton
android:id="@+id/toggle_button_6" android:layout_alignParentTop="true"
android:layout_marginLeft="10dip" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_toRightOf="@+id/toggle_button_5" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
custom_toggle_button.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="80dip" android:layout_marginTop="0dip"
android:layout_height="46dip" android:background="@+drawable/button_bg_normal"
android:id="@+id/custom_toggle_button" android:orientation="vertical" >
<TextView android:id="@+id/toggle_button_text" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_marginTop="50dip"
android:textColor="@+color/red" android:layout_marginLeft="20dip" />
<ImageView android:id="@+id/toggle_button_lightbar" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_below="@+id/toggle_button_text"
android:layout_marginTop="10dip" android:src="@+drawable/llightbar_off"
android:layout_marginLeft="5dip" />
</LinearLayout>
CustomView.java
package com.android.customview;
import java.util.ArrayList;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
public class CustomView extends Activity implements OnClickListener {
private CustomToggleButton mToggleButton1;
private CustomToggleButton mToggleButton2;
private CustomToggleButton mToggleButton3;
private CustomToggleButton mToggleButton4;
private CustomToggleButton mToggleButton5;
private CustomToggleButton mToggleButton6;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mToggleButton1 = (CustomToggleButton)findViewById(R.id.toggle_button_1);
mToggleButton1.setText("Button1");
mToggleButton1.setOnClickListener(this);
mToggleButton2 = (CustomToggleButton)findViewById(R.id.toggle_button_2);
mToggleButton2.setText("Button2");
mToggleButton2.setOnClickListener(this);
mToggleButton3 = (CustomToggleButton)findViewById(R.id.toggle_button_3);
mToggleButton3.setText("Button3");
mToggleButton3.setOnClickListener(this);
mToggleButton4 = (CustomToggleButton)findViewById(R.id.toggle_button_4);
mToggleButton4.setText("Button4");
mToggleButton4.setOnClickListener(this);
mToggleButton5 = (CustomToggleButton)findViewById(R.id.toggle_button_5);
mToggleButton5.setText("Button5");
mToggleButton5.setOnClickListener(this);
mToggleButton6 = (CustomToggleButton)findViewById(R.id.toggle_button_6);
mToggleButton6.setText("Button6");
mToggleButton6.setOnClickListener(this);
addTrackballItems();
}
@Override
public void onClick(View v) {
int resId = v.getId();
handleButtonEvent(resId);
}
private void handleButtonEvent(int resId){
switch (resId){
case R.id.toggle_button_1:
mToggleButton1.setChecked(true);
Intent intent = new Intent();
intent.setClass(this, TestBringToFront.class);
startActivity(intent);
break;
case R.id.toggle_button_2:
mToggleButton2.setChecked(true);
break;
case R.id.toggle_button_3:
mToggleButton3.setChecked(true);
break;
case R.id.toggle_button_4:
mToggleButton4.setChecked(true);
break;
case R.id.toggle_button_5:
mToggleButton5.setChecked(true);
break;
case R.id.toggle_button_6:
mToggleButton6.setChecked(true);
break;
}
}
private int convertIndexToResId(int curIndex){
if (curIndex == 0){
return R.id.toggle_button_1;
}else if (curIndex == 1){
return R.id.toggle_button_2;
}else if (curIndex == 2){
return R.id.toggle_button_3;
}else if (curIndex == 3){
return R.id.toggle_button_4;
}else if (curIndex == 4){
return R.id.toggle_button_5;
}else {
return R.id.toggle_button_6;
}
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode){
case KeyEvent.KEYCODE_DPAD_UP:
searchUpFocus();
break;
case KeyEvent.KEYCODE_DPAD_DOWN:
searchDownFocus();
break;
case KeyEvent.KEYCODE_DPAD_RIGHT:
searchRightFocus();
break;
case KeyEvent.KEYCODE_DPAD_LEFT:
searchLeftFocus();
break;
case KeyEvent.KEYCODE_DPAD_CENTER:
handleButtonEvent(convertIndexToResId(mCurTrackballIndex));
break;
}
return super.onKeyDown(keyCode, event);
}
private ArrayList<View> mTrackballItems = new ArrayList<View>();
private int mCurTrackballIndex = 0;
private int mTrackballItemsCount = 0;
private void addTrackballItems(){
mTrackballItems.add(mToggleButton1); // index = 0
mTrackballItems.add(mToggleButton2); // index = 1
mTrackballItems.add(mToggleButton3); // index = 2
mTrackballItems.add(mToggleButton4); // index = 3
mTrackballItems.add(mToggleButton5); // index = 4
mTrackballItems.add(mToggleButton6); // index = 5
mTrackballItemsCount = mTrackballItems.size();
}
private void searchUpFocus(){
if (mTrackballItems.get(mCurTrackballIndex).isSelected()){
if (mCurTrackballIndex - 3 >= 0){
mTrackballItems.get(mCurTrackballIndex).setSelected(false);
mCurTrackballIndex = mCurTrackballIndex - 3;
}else {
return;
}
}else {
mCurTrackballIndex = 0;
}
mTrackballItems.get(mCurTrackballIndex).setSelected(true);
setCurFocus(mCurTrackballIndex);
}
private void searchDownFocus(){
if (mTrackballItems.get(mCurTrackballIndex).isSelected()){
if (mCurTrackballIndex - 3 < 0){
mTrackballItems.get(mCurTrackballIndex).setSelected(false);
mCurTrackballIndex = mCurTrackballIndex + 3;
}else {
return;
}
}else {
mCurTrackballIndex = 0;
}
mTrackballItems.get(mCurTrackballIndex).setSelected(true);
setCurFocus(mCurTrackballIndex);
}
private void searchRightFocus(){
boolean isVaildUpRow = (mCurTrackballIndex >= 0) && (mCurTrackballIndex < 3);
boolean isVaildDownRow = (mCurTrackballIndex >= 3) && (mCurTrackballIndex < 5);
if (mTrackballItems.get(mCurTrackballIndex).isSelected()){
if (isVaildUpRow || isVaildDownRow){
mTrackballItems.get(mCurTrackballIndex).setSelected(false);
mCurTrackballIndex = mCurTrackballIndex + 1;
}else {
return;
}
}else {
mCurTrackballIndex = 0;
}
mTrackballItems.get(mCurTrackballIndex).setSelected(true);
setCurFocus(mCurTrackballIndex);
}
private void searchLeftFocus(){
boolean isVaildUpRow = (mCurTrackballIndex > 0) && (mCurTrackballIndex <= 3);
boolean isVaildDownRow = (mCurTrackballIndex > 3) && (mCurTrackballIndex <= 5);
if (mTrackballItems.get(mCurTrackballIndex).isSelected()){
if (isVaildUpRow || isVaildDownRow){
mTrackballItems.get(mCurTrackballIndex).setSelected(false);
mCurTrackballIndex = mCurTrackballIndex - 1;
}else {
return;
}
}else {
mCurTrackballIndex = 0;
}
mTrackballItems.get(mCurTrackballIndex).setSelected(true);
setCurFocus(mCurTrackballIndex);
}
private void setCurFocus(int curIndex){
clearAllFocus();
((CustomToggleButton)mTrackballItems.get(curIndex)).setBgFocus();
}
private void clearAllFocus(){
for (int i = 0; i < mTrackballItemsCount; i++){
((CustomToggleButton)mTrackballItems.get(i)).clearBgFocus();
}
}
}
CustomToggleButton.java
package com.android.customview;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
public class CustomToggleButton extends LinearLayout{
private Context mContext;
private LinearLayout mCustomToggleButton;
private TextView mText;
private ImageView mLightbar;
public CustomToggleButton(Context context) {
super(context);
mContext = context;
initView();
}
public CustomToggleButton(Context context, AttributeSet attrs) {
super(context, attrs);
mContext = context;
initView();
}
private void initView(){
LinearLayout l = (LinearLayout)View.inflate(mContext, R.layout.custom_toggle_button, null);
addView(l);
mCustomToggleButton = (LinearLayout)findViewById(R.id.custom_toggle_button);
// mCustomToggleButton.setOnClickListener(this);
mText = (TextView)findViewById(R.id.toggle_button_text);
mLightbar = (ImageView)findViewById(R.id.toggle_button_lightbar);
}
public void setText(String text){
mText.setText(text);
}
public void setChecked(boolean isChecked){
if (isChecked){
mLightbar.setImageResource(R.drawable.lightbar_on);
}else {
mLightbar.setImageResource(R.drawable.lightbar_off);
}
}
public void setBgFocus(){
mCustomToggleButton.setBackgroundResource(R.drawable.button_bg_focus);
}
public void clearBgFocus(){
mCustomToggleButton.setBackgroundResource(R.drawable.button_bg_normal);
}
}
发表评论
-
eclipse中安装插件地址
2014-03-07 15:08 761http://subclipse.tigris.org/up ... -
ubuntu13下载android源码
2014-02-27 18:23 644一、注意repo的正确地址 repo:curl " ... -
用例无法运行,报如下错:Exception during suite construction
2014-02-26 15:47 1274一 前提 1、 测试工程中的所有参数已配置好,如ins ... -
dx.jar dx.bat
2013-06-17 19:33 2267Android SDK中dx.jar, dx.bat文件的备份 ... -
Please ensure that adb is correctly located..... 问题
2013-04-16 09:44 972解决方法: 方法一、查毒杀毒,也许了病毒占用了adb ... -
PC端通过adb与设备端通信
2013-03-28 09:36 1526adb 全称Android Debug Bri ... -
Unable to execute dex: Multiple dex files define Lorg/taptwo/android/widget/Circ
2013-02-21 15:07 2586问题:[2013-02-21 15:01:02 - Dex ... -
android viewTree and decorView
2013-01-30 13:55 1702Android ViewTree and DecorView ... -
No active compatible AVD's or devices found. Relaunch this configuration after c
2013-01-29 10:56 8765问题:No active compatible AVD's ... -
代码对比工具
2013-01-24 15:33 658windows: http://www.scooterso ... -
android最新源码下载
2013-01-23 09:57 1054源码下载:https://source.android.co ... -
Run MonkeyTalk Scripts via Ant in Windows
2012-12-18 20:24 1288Run MonkeyTalk Scripts via ... -
Android中cpu,memory,Battery的计算
2012-11-20 19:59 66161 Memory的分配(RAM而非ROM) 网址: •ht ... -
http://code.taobao.org/p/TMTS/src/
2012-10-12 17:38 1036http://code.taobao.org/p/TMTS/s ... -
string.xml文件中的特殊符号转换符
2012-09-24 09:09 783strings.xml文件中需要对特殊符号(如%,'等)进行转 ... -
web server 中设置wifi代理
2012-09-24 09:07 901DefaultHttpClient httpClient = ... -
Android开发一些常见问题
2012-09-24 09:06 7481:当追踪问题时,代码中实在找不出问题所以,代码的逻辑完全正确 ... -
将log信息写入sdcard
2012-07-05 17:14 877File mFile; private void write ... -
string.xml文件中的特殊符号转换符
2012-06-19 19:39 1062strings.xml文件中需要对特殊符号(如%,'等)进行转 ... -
关于popupWindow的dismiss
2012-06-17 16:13 8596View contentView = LayoutInflat ...
相关推荐
在 MATLAB 中实现轨迹球功能,可以提供更加流畅和直观的3D视图操作体验。 以下是如何在 MATLAB 中应用轨迹球技术的一些建议和步骤: 1. **实现轨迹球算法**:首先,你需要编写或找到一个实现轨迹球旋转的函数。这...
2. **动画和交互**:使用Silverlight的Timeline和Storyboard对象,可以创建流畅的动画效果,如球员跑动、球飞行轨迹等。同时,通过事件处理机制,可以响应用户的输入,如点击、拖动等,使3D对象动态响应用户操作。 ...
在提供的"Guiji"文件中,可能包含了实现这些功能的源代码,包括自定义View的实现、轨迹计算逻辑以及MediaPlayer的使用示例。分析这些代码可以帮助你更深入地理解这个项目的实现细节。在实际开发中,你还需要考虑性能...
本文将详细介绍如何在Android中自定义一个名为BezierView的View,实现一个弹性小球沿固定轨迹弹动的效果。 首先,我们来看一下关键的自定义代码示例。`BezierView`继承自Android的`View`类,它包含了绘制小球和控制...
在实际项目中,可能还需要考虑平滑旋转、滚轮缩放等功能,但这个基础示例展示了如何在不使用轨迹球或四元数的情况下,通过Qt和OpenGL实现基本的鼠标交互。轨迹球和四元数通常用于更复杂的旋转操作,如防抖动和平滑...
在Android开发中,创建引人入胜的交互式UI元素是一项重要的任务,"Android 弹力小球实例"就是这样一个示例,它结合了物理模拟和动画效果,为用户提供了一个有趣的体验。在这个实例中,我们将深入探讨如何实现小球的...
在本示例中,当用户按下屏幕时,小球的位置被记录;当用户移动手指时,更新小球位置;手指抬起时,停止更新。 2. **View的重绘机制**: 在Android中,`View`的绘制是通过`onDraw()`方法实现的。当小球位置发生变化...
在Android开发中,自定义View组件是提升应用用户体验和实现独特设计的重要手段。"MyBall.zip"中的项目显然是一个基于Android平台的自定义View实例,它展示了一个小球在屏幕上移动,当碰到屏幕边缘时会反弹,然后继续...
【文件名称列表解析】:只有一个文件名为“小球源码”,这可能是一个压缩文件,解压后可能包含多个子文件夹或文件,分别对应不同的小球运动实现或功能模块,如主程序、布局文件、图片资源、类文件等。 综合以上分析...
然而,在这个动画示例中,我们主要关注的是动画路径,而非实际绘制椭圆。 4. 添加动画到视图: 最后,将创建好的动画添加到视图的层(CALayer)上,然后启动动画。 ```swift view.layer.add(pathAnimation, for...
在示例代码中,`RepeatingImageButton`扩展了`ImageButton`,并添加了一个`RepeatListener`接口,用于处理长按过程中的重复事件。当用户按下按钮时,`performLongClick()`方法被调用,记录长按的开始时间,并启动一...
常见的控制方法包括按键、轨迹球、触屏、重力感应、摄像头、话筒气流和光线亮度等。其中,触屏是最常用且直观的交互方式,适用于大多数游戏类型;而重力感应则常用于模拟运动或导航游戏,提供更为真实的操控感。 ##...
在计算机图形学中,矩阵乘法是实现所有变换的基础。具体到OpenGL中,对象的变换同样基于矩阵操作。为了有效地管理和使用这些变换矩阵,OpenGL引入了矩阵堆栈的概念。 - **定义**: 矩阵堆栈是一个用于保存和恢复矩阵...
"OpenSceneGraph三维渲染引擎编程指南"这本书应该会详细介绍以上概念,并提供实际代码示例,帮助读者深入理解OSG的各个功能模块,以及如何在实际项目中应用它们。通过学习这些DEMO,开发者不仅可以掌握OSG的基本用法...
在示例中,`contour3`用于创建3D空间的等高线,而`contour`则用于在XY平面上投影等高线。通过调整参数,可以改变等高线的数量和范围,以获得不同的视觉效果。 3. **Plot3函数**: `plot3`函数用于在3D空间中绘制...
在Android开发中,UI设计和动画的实现是提升用户体验的关键因素。`AdhesiveLoadingViewAndroid.zip`是一个关于Android自定义视图的项目,它提供了一种创新的加载动画——粘性滑动小球loading。这种动画效果使得用户...
本教程将围绕"篮球弹跳动画(很Q的感觉)"这一主题,详细介绍如何在Android应用中实现一个具有Q版效果的篮球弹跳动画。 首先,弹跳动画通常涉及到Android的属性动画系统,它允许开发者在对象之间创建平滑的过渡效果...
在提供的链接中,作者可能详细介绍了如何实现这一效果,包括代码示例和实际的动画展示。通过阅读博客文章,你可以更深入地了解具体的实现细节和技术要点。同时,记得在实践中要注意性能优化,避免过度绘制和不必要的...
如果设置为`true`,即使在没有触摸屏幕时,用户可以通过方向键或轨迹球在控件间切换焦点。 总的来说,Android中的`OnFocuChangeListener`是用于监控View焦点状态变化的关键工具,它可以用来实现各种定制化的交互...
JBox2D则为Java开发者提供了同样的功能,使得在Android平台实现物理模拟成为可能。 二、PhysicsLayout的原理 PhysicsLayout是将JBox2D与Android的布局系统结合的框架。它将Android视图(View)转换为物理世界的实体...