2

我正在为 android 制作一个启动器,它只能在横向中使用。屏幕的一半是按钮,不是应用程序,而是按钮,一半只是一些时钟之类的东西。我希望我的按钮在我触摸它们时会发光一秒钟或其他东西,然后是动画以显示不同的屏幕。我只需要发光的帮助。请帮助我,非常感谢!

这是我的xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mainLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/wallpaper" >

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="match_parent" >

</LinearLayout>


<GridView
    android:id="@+id/gridView1"
    android:layout_width="284dp"
    android:layout_height="wrap_content"
    android:numColumns="3" >

</GridView>

我也想知道如何将图像按钮添加到我的 gridview

我的Java代码:

package com.mysoftware.mysoftwareos.launcher;

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

public class MainActivity extends Activity implements OnClickListener {
LinearLayout mainLayout;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    //Import views
    mainLayout = (LinearLayout)findViewById(R.id.mainLayout);

    //Setup onClickListener for the buttons

}
@Override
public boolean onKeyDown(int KeyCode, KeyEvent event) {
    if ((KeyCode == KeyEvent.KEYCODE_BACK)) {
        //Do nothing to prevent the back button to kill the launcher
        return true;
    }
    return super.onKeyDown(KeyCode, event);
}
public void onClick(View src) {
    switch(src.getId()) {
    }
}
}
4

0 回答 0