Android学习教程之滑动布局(14)

本文实例为大家分享了Android滑动布局的具体代码,供大家参考,具体内容如下

MainActivity.java代码:

package siso.swipelayoutdemo;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;

import com.nineoldandroids.view.ViewHelper;

import siso.swipelib.SwipeLayout;

public class MainActivity extends AppCompatActivity {

 private SwipeLayout sample1, sample2, sample3;

 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.main);

 sample1 = (SwipeLayout) findViewById(R.id.sample1);
 sample1.setShowMode(SwipeLayout.ShowMode.PullOut);
 View starBottView = sample1.findViewById(R.id.starbott);
 sample1.addDrag(SwipeLayout.DragEdge.Left, sample1.findViewById(R.id.bottom_wrapper));
 sample1.addDrag(SwipeLayout.DragEdge.Right, sample1.findViewById(R.id.bottom_wrapper_2));
 sample1.addDrag(SwipeLayout.DragEdge.Top, starBottView);
 sample1.addDrag(SwipeLayout.DragEdge.Bottom, starBottView);
 sample1.addRevealListener(R.id.delete, new SwipeLayout.OnRevealListener() {
  @Override
  public void onReveal(View child, SwipeLayout.DragEdge edge, float fraction, int distance) {

  }
 });

 sample1.getSurfaceView().setOnClickListener(new View.OnClickListener() {
  @Override
  public void onClick(View v) {
  Toast.makeText(MainActivity.this, "Click on surface", Toast.LENGTH_SHORT).show();
  Log.d(MainActivity.class.getName(), "click on surface");
  }
 });
 sample1.getSurfaceView().setOnLongClickListener(new View.OnLongClickListener() {
  @Override
  public boolean onLongClick(View v) {
  Toast.makeText(MainActivity.this, "longClick on surface", Toast.LENGTH_SHORT).show();
  Log.d(MainActivity.class.getName(), "longClick on surface");
  return true;
  }
 });
 sample1.findViewById(R.id.star2).setOnClickListener(new View.OnClickListener() {
  @Override
  public void onClick(View v) {
  Toast.makeText(MainActivity.this, "Star", Toast.LENGTH_SHORT).show();
  }
 });

 sample1.findViewById(R.id.trash2).setOnClickListener(new View.OnClickListener() {
  @Override
  public void onClick(View v) {
  Toast.makeText(MainActivity.this, "Trash Bin", Toast.LENGTH_SHORT).show();
  }
 });

 sample1.findViewById(R.id.magnifier2).setOnClickListener(new View.OnClickListener() {
  @Override
  public void onClick(View v) {
  Toast.makeText(MainActivity.this, "Magnifier", Toast.LENGTH_SHORT).show();
  }
 });

 sample1.addRevealListener(R.id.starbott, new SwipeLayout.OnRevealListener() {
  @Override
  public void onReveal(View child, SwipeLayout.DragEdge edge, float fraction, int distance) {
  View star = child.findViewById(R.id.star);
  float d = child.getHeight() / 2 - star.getHeight() / 2;
  ViewHelper.setTranslationY(star, d * fraction);
  ViewHelper.setScaleX(star, fraction + 0.6f);
  ViewHelper.setScaleY(star, fraction + 0.6f);
  }
 });

 //sample2

 sample2 = (SwipeLayout) findViewById(R.id.sample2);
 sample2.setShowMode(SwipeLayout.ShowMode.LayDown);
 sample2.addDrag(SwipeLayout.DragEdge.Right, sample2.findViewWithTag("Bottom2"));
 sample2.findViewById(R.id.star).setOnClickListener(new View.OnClickListener() {
  @Override
  public void onClick(View v) {
  Toast.makeText(MainActivity.this, "Star", Toast.LENGTH_SHORT).show();
  }
 });

 sample2.findViewById(R.id.trash).setOnClickListener(new View.OnClickListener() {
  @Override
  public void onClick(View v) {
  Toast.makeText(MainActivity.this, "Trash Bin", Toast.LENGTH_SHORT).show();
  }
 });

 sample2.findViewById(R.id.magnifier).setOnClickListener(new View.OnClickListener() {
  @Override
  public void onClick(View v) {
  Toast.makeText(MainActivity.this, "Magnifier", Toast.LENGTH_SHORT).show();
  }
 });

 sample2.findViewById(R.id.click).setOnClickListener(new View.OnClickListener() {
  @Override
  public void onClick(View v) {
  Toast.makeText(MainActivity.this, "Yo", Toast.LENGTH_SHORT).show();
  }
 });
 sample2.getSurfaceView().setOnClickListener(new View.OnClickListener() {
  @Override
  public void onClick(View v) {
  Toast.makeText(MainActivity.this, "Click on surface", Toast.LENGTH_SHORT).show();
  }
 });

 //sample3

 sample3 = (SwipeLayout) findViewById(R.id.sample3);
 sample3.addDrag(SwipeLayout.DragEdge.Top, sample3.findViewWithTag("Bottom3"));
 sample3.addRevealListener(R.id.bottom_wrapper_child1, new SwipeLayout.OnRevealListener() {
  @Override
  public void onReveal(View child, SwipeLayout.DragEdge edge, float fraction, int distance) {
  View star = child.findViewById(R.id.star);
  float d = child.getHeight() / 2 - star.getHeight() / 2;
  ViewHelper.setTranslationY(star, d * fraction);
  ViewHelper.setScaleX(star, fraction + 0.6f);
  ViewHelper.setScaleY(star, fraction + 0.6f);
  int c = (Integer) evaluate(fraction, Color.parseColor("#dddddd"), Color.parseColor("#4C535B"));
  child.setBackgroundColor(c);
  }
 });
 sample3.findViewById(R.id.bottom_wrapper_child1).setOnClickListener(new View.OnClickListener() {
  @Override
  public void onClick(View v) {
  Toast.makeText(MainActivity.this, "Yo!", Toast.LENGTH_SHORT).show();
  }
 });
 sample3.getSurfaceView().setOnClickListener(new View.OnClickListener() {
  @Override
  public void onClick(View v) {
  Toast.makeText(MainActivity.this, "Click on surface", Toast.LENGTH_SHORT).show();
  }
 });

 }

 @Override
 public boolean onCreateOptionsMenu(Menu menu) {

 getMenuInflater().inflate(R.menu.my, menu);
 return true;
 }

 @Override
 public boolean onOptionsItemSelected(MenuItem item) {

 int id = item.getItemId();
 if (id == R.id.action_listview) {
  startActivity(new Intent(this, ListViewExample.class));
  return true;
 } else if (id == R.id.action_gridview) {
  startActivity(new Intent(this, GridViewExample.class));
  return true;
 } else if (id == R.id.action_nested) {
  startActivity(new Intent(this, NestedExample.class));
  return true;
 } else if (id == R.id.action_recycler) {
  startActivity(new Intent(this, RecyclerViewExample.class));
 }
 return super.onOptionsItemSelected(item);
 }

 /*
 Color transition method.
 */
 public Object evaluate(float fraction, Object startValue, Object endValue) {
 int startInt = (Integer) startValue;
 int startA = (startInt >> 24) & 0xff;
 int startR = (startInt >> 16) & 0xff;
 int startG = (startInt >> 8) & 0xff;
 int startB = startInt & 0xff;

 int endInt = (Integer) endValue;
 int endA = (endInt >> 24) & 0xff;
 int endR = (endInt >> 16) & 0xff;
 int endG = (endInt >> 8) & 0xff;
 int endB = endInt & 0xff;

 return (int) ((startA + (int) (fraction * (endA - startA))) << 24) |
  (int) ((startR + (int) (fraction * (endR - startR))) << 16) |
  (int) ((startG + (int) (fraction * (endG - startG))) << 8) |
  (int) ((startB + (int) (fraction * (endB - startB))));
 }
}

NestedExample.java代码:

package siso.swipelayoutdemo;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import siso.swipelib.SwipeLayout;

public class NestedExample extends Activity{

 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.complicate_layout);
  SwipeLayout swipeLayout = (SwipeLayout)findViewById(R.id.test_swipe_swipe);
 swipeLayout.setOnDoubleClickListener(new SwipeLayout.DoubleClickListener() {
  @Override
  public void onDoubleClick(SwipeLayout layout, boolean surface) {
  Toast.makeText(getApplicationContext(), "DoubleClick", Toast.LENGTH_SHORT).show();
  }
 });
 swipeLayout.findViewById(R.id.trash).setOnClickListener(new View.OnClickListener() {
  @Override
  public void onClick(View v) {
  Toast.makeText(getApplicationContext(), "Click", Toast.LENGTH_SHORT).show();
  }
 });
 }
}

RecyclerViewExample.java代码:

package siso.swipelayoutdemo;

import android.app.ActionBar;
import android.app.Activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;

import java.util.ArrayList;
import java.util.Arrays;

import jp.wasabeef.recyclerview.animators.FadeInLeftAnimator;
import siso.swipelayoutdemo.adapter.RecyclerViewAdapter;
import siso.swipelayoutdemo.adapter.util.DividerItemDecoration;
import siso.swipelib.util.Attributes;

public class RecyclerViewExample extends Activity {

 private RecyclerView recyclerView;
 private RecyclerView.Adapter mAdapter;

 private ArrayList<String> mDataSet;

 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.recyclerview);
 recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
  ActionBar actionBar = getActionBar();
  if (actionBar != null) {
  actionBar.setTitle("RecyclerView");
  }
 }

 // Layout Managers:
 recyclerView.setLayoutManager(new LinearLayoutManager(this));

 // Item Decorator:
 recyclerView.addItemDecoration(new DividerItemDecoration(getResources().getDrawable(R.drawable.divider)));
 recyclerView.setItemAnimator(new FadeInLeftAnimator());

 // Adapter:
 String[] adapterData = new String[]{"Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"};
 mDataSet = new ArrayList<String>(Arrays.asList(adapterData));
 mAdapter = new RecyclerViewAdapter(this, mDataSet);
 ((RecyclerViewAdapter) mAdapter).setMode(Attributes.Mode.Single);
 recyclerView.setAdapter(mAdapter);

 /* Listeners */
 recyclerView.setOnScrollListener(onScrollListener);
 }

 RecyclerView.OnScrollListener onScrollListener = new RecyclerView.OnScrollListener() {
 @Override
 public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
  super.onScrollStateChanged(recyclerView, newState);
  Log.e("ListView", "onScrollStateChanged");
 }

 @Override
 public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
  super.onScrolled(recyclerView, dx, dy);

 }
 };

 @Override
 public boolean onCreateOptionsMenu(Menu menu) {

 getMenuInflater().inflate(R.menu.my, menu);
 return true;
 }

 @Override
 public boolean onOptionsItemSelected(MenuItem item) {

 int id = item.getItemId();
 if (id == R.id.action_listview) {
  startActivity(new Intent(this, ListViewExample.class));
  finish();
  return true;
 } else if (id == R.id.action_gridview) {
  startActivity(new Intent(this, GridViewExample.class));
  finish();
  return true;
 }
 return super.onOptionsItemSelected(item);
 }
}

ListViewExample.java代码:

package siso.swipelayoutdemo;

import android.app.ActionBar;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.Toast;

import siso.swipelayoutdemo.adapter.ListViewAdapter;
import siso.swipelib.SwipeLayout;
import siso.swipelib.util.Attributes;

public class ListViewExample extends Activity {

 private ListView mListView;
 private ListViewAdapter mAdapter;
 private Context mContext = this;

 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.listview);
 mListView = (ListView) findViewById(R.id.listview);
 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
  ActionBar actionBar = getActionBar();
  if (actionBar != null) {
  actionBar.setTitle("ListView");
  }
 }

 mAdapter = new ListViewAdapter(this);
 mListView.setAdapter(mAdapter);
 mAdapter.setMode(Attributes.Mode.Single);
 mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  @Override
  public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  ((SwipeLayout)(mListView.getChildAt(position - mListView.getFirstVisiblePosition()))).open(true);
  }
 });
 mListView.setOnTouchListener(new View.OnTouchListener() {
  @Override
  public boolean onTouch(View v, MotionEvent event) {
  Log.e("ListView", "OnTouch");
  return false;
  }
 });
 mListView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
  @Override
  public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
  Toast.makeText(mContext, "OnItemLongClickListener", Toast.LENGTH_SHORT).show();
  return true;
  }
 });
 mListView.setOnScrollListener(new AbsListView.OnScrollListener() {
  @Override
  public void onScrollStateChanged(AbsListView view, int scrollState) {
  Log.e("ListView", "onScrollStateChanged");
  }

  @Override
  public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {

  }
 });

 mListView.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
  @Override
  public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
  Log.e("ListView", "onItemSelected:" + position);
  }

  @Override
  public void onNothingSelected(AdapterView<?> parent) {
  Log.e("ListView", "onNothingSelected:");
  }
 });

 }

 @Override
 public boolean onCreateOptionsMenu(Menu menu) {

 getMenuInflater().inflate(R.menu.my, menu);
 return true;
 }

 @Override
 public boolean onOptionsItemSelected(MenuItem item) {

 int id = item.getItemId();
 if (id == R.id.action_listview) {
  startActivity(new Intent(this, ListViewExample.class));
  finish();
  return true;
 } else if (id == R.id.action_gridview) {
  startActivity(new Intent(this, GridViewExample.class));
  finish();
  return true;
 } else if (id == R.id.action_recycler) {
  startActivity(new Intent(this, RecyclerViewExample.class));
  finish();
  return true;
 }
 return super.onOptionsItemSelected(item);
 }
}

GridViewExample.java代码:

package siso.swipelayoutdemo;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;

import siso.swipelayoutdemo.adapter.GridViewAdapter;
import siso.swipelib.util.Attributes;

public class GridViewExample extends Activity{

 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.gridview);
 final GridView gridView = (GridView)findViewById(R.id.gridview);
 final GridViewAdapter adapter = new GridViewAdapter(this);
 adapter.setMode(Attributes.Mode.Multiple);
 gridView.setAdapter(adapter);
 gridView.setSelected(false);
 gridView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
  @Override
  public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
  Log.e("onItemLongClick","onItemLongClick:" + position);
  return false;
  }
 });
 gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  @Override
  public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  Log.e("onItemClick","onItemClick:" + position);
  }
 });

 gridView.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
  @Override
  public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
  Log.e("onItemSelected","onItemSelected:" + position);
  }

  @Override
  public void onNothingSelected(AdapterView<?> parent) {

  }
 });

 }
}

app项目结构:

Andriod类库项目结构:

build.gradle

apply plugin: 'com.android.application'

android {
 compileSdkVersion 23
 buildToolsVersion "23.0.1"

 defaultConfig {
 applicationId "siso.swipelayoutdemo"
 minSdkVersion 22
 targetSdkVersion 22
 versionCode 1
 versionName "1.0"
 }
 buildTypes {
 release {
  minifyEnabled false
  proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
 }
 }
}

dependencies {
 compile fileTree(include: ['*.jar'], dir: 'libs')
 testCompile 'junit:junit:4.12'
 compile 'com.android.support:appcompat-v7:23.0.1'
 compile project(path: ':swipelib')
 compile 'com.android.support:recyclerview-v7:23.3.0'
 compile 'com.daimajia.easing:library:1.0.0@aar'
 compile 'com.daimajia.androidanimations:library:1.1.2@aar'
 compile 'com.nineoldandroids:library:2.4.0'
 compile 'jp.wasabeef:recyclerview-animators:1.0.3@aar'
}

运行结果如图:

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持我们。

(0)

相关推荐

  • 代码从windows下visual studio到andriod平台迁移实现步骤

    代码从windows下visual studio到andriod平台迁移实现步骤: 前言 前言也是迁言,从windows的visual studio 2012平台迁移到Android平台上,需用修改挺多的代码和需用注意地方. 我们当然的平台当初就考虑了其他平台跨平台的应用问题,所以一开始在windows下就是用cmake来完成工程的建立的,cMakeLists.txt文件都做了一些处理,但是此时只是更针对或说首先保证windows下的编译和使用. 谨此做个记录. 1. modify cMakeL

  • Andriod 自定义控件之音频条

    今天我们实现一个直接继承于View的全新控件.大家都知道音乐播放器吧,在点击一首歌进行播放时,通常会有一块区域用于显示音频条,我们今天就来学习下,播放器音频条的实现. 首先我们还是先定义一个类,直接继承于View,并重写它的构造方法,并初始化一个画笔,这和上一节是同样的道理.直接贴出代码: public class AudioBar extends View{ private Paint mTextPaint; public AudioBar(Context context) { this(co

  • Andriod arcgis保存Mapview为图片的实例代码

    废话不多说了,直接给大家贴代码了,具体代码如下所述: /** * 把一个View的对象转换成bitmap */ private Bitmap getViewBitmap(MapView v) { v.clearFocus(); v.setPressed(false); //能画缓存就返回false boolean willNotCache = v.willNotCacheDrawing(); v.setWillNotCacheDrawing(false); int color = v.getDr

  • Andriod开发中常见问题

    本文为大家总结了Andriod开发中常遇到的问题,供大家学习,具体内容如下 1.Andriod中布局中引用布局的问题 (使用如下方法即可,布局中引用布局可以起到节省资源的问题) <LinearLayout> <include layout="@layout/buttom"> </LinearLayout> 2.如何判断你的手机版本是不是4.0以上 if(Android.os.Build.VERSION.SDK_INT>10) 3.屏幕切换问题和

  • Andriod开发中引入jar包的正确方式介绍

    andriod中如果引入jar包的方式不对就会出现一些奇怪的错误. 工作的时候恰好有一个jar包需要调用,结果用了很长时间才解决出现的bug. 刚开始是这样引用的(eclipse): 右键工程,Build path,java build path, 选择libraries,在右边的按钮中点击"Add External JARs", 然后选择合适的jar包(大部分人应该会这样做). 结果控制台立刻报错:conversion to dalvik format failed with err

  • Java实现Andriod带看括弧的计算器代码

    废话不多说了,一切尽在代码中,具体代码如下所示: 界面 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_par

  • Andriod 获取电池的信息实例代码

    具体代码如下所示: <?xml version="1.0"?> <LinearLayout android:orientation="vertical" android:layout_height="match_parent" android:layout_width="match_parent" xmlns:tools="http://schemas.android.com/tools"

  • Andriod 资源文件之存取操作

    废话不多说了,直接给大家贴代码了.具体代码如下所述: <?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="mat

  • Andriod 读取网络图片实例代码解析

    Android手机上,我们常用ImageView显示图片,我们本章获取网络图片并显示在ImageView中. 一.设计界面 1.布局文件 打开res/layout/activity_main.xml文件. 输入以下代码: <?xml version="." encoding="utf-"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android&qu

  • Android学习教程之滑动布局(14)

    本文实例为大家分享了Android滑动布局的具体代码,供大家参考,具体内容如下 MainActivity.java代码: package siso.swipelayoutdemo; import android.app.Activity; import android.content.Intent; import android.graphics.Color; import android.support.v7.app.AppCompatActivity; import android.os.B

  • Andriod学习教程之滑动布局(14)

    本文实例为大家分享了Andriod滑动布局的具体代码,供大家参考,具体内容如下 MainActivity.java代码: package siso.swipelayoutdemo; import android.app.Activity; import android.content.Intent; import android.graphics.Color; import android.support.v7.app.AppCompatActivity; import android.os.B

  • Android运用onTouchEvent自定义滑动布局

    写在自定义之前 我们也许会遇到,自定义控件的触屏事件处理,先来了解一下View类中的,onTouch事件和onTouchEvent事件. 1.boolean onTouch(View v, MotionVent event) 触摸事件发送到视图时调用(v:视图,event:触摸事件) 返回true:事件被完全消耗(即,从down事件开始,触发move,up所有的事件) 返回fasle:事件未被完全消耗(即,只会消耗掉down事件) 2.boolean onTouchEvent(MotionEve

  • Android学习教程之图片毛玻璃效果(4)

    本教程为大家分享了Android毛玻璃效果的具体代码,供大家参考,具体内容如下 BlurimageActivity.java代码: package com.siso.crazyworld; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.support.v7.app.AppCompatActivit

  • Android学习教程之日历库使用(15)

    本教程为大家分享了Android日历库的使用方法,供大家参考,具体内容如下 MainActivity.java代码: package siso.weekv; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; public class MainActivity extends AppCo

  • Android学习教程之圆形Menu菜单制作方法(1)

    本文实例为大家分享了Android圆形菜单的使用方法,供大家参考,具体内容如下 MainActivity.java代码: package siso.handlerdemo; import android.app.NotificationManager; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.vi

  • Android学习教程之动态GridView控件使用(6)

    本文实例为大家分享了Android动态GridView控件使用的具体代码,供大家参考,具体内容如下 MainActivity.java代码: package siso.haha; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button

  • Android学习教程之九宫格图片展示(13)

    本文实例为大家分享了Android九宫格图片展示的具体代码,供大家参考,具体内容如下 MainActivity.java代码: package siso.ninegridimg; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCrea

  • Android学习教程之悬浮窗菜单制作(9)

    本文实例为大家分享了Android悬浮窗菜单的具体代码,供大家参考,具体内容如下 MainActivity.java代码: package siso.multilistview; import android.os.Build; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; public class MainActivity extends

  • Android学习教程之高仿安卓微信6.0(2)

    本文实例为大家分享了Android仿安卓微信6.0的具体代码,供大家参考,具体内容如下 wechat6Activity.java的代码: package siso.geekworld; import android.app.Activity; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android

随机推荐