package com.star.explorer;
import java.util.ArrayList;
import java.util.List;
import com.star.explorer.R;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.AnimationUtils;
import android.view.animation.LayoutAnimationController;
import android.view.animation.RotateAnimation;
import android.view.animation.ScaleAnimation;
import android.view.animation.TranslateAnimation;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;
public class ShowAppActivity extends Activity implements Runnable ,OnItemClickListener {
private static final int SEARCH_APP = 0;
private static final int DELETE_APP = 1;
GridView gv;
ListView lv;
private List<PackageInfo> packageInfos;
private List<PackageInfo> userPackageInfos;
private List<PackageInfo> showPackageInfos;
private ProgressDialog pd;
ImageButton ib_change_category;
ImageButton ib_change_view;
private boolean allApplication = true;
private boolean isListView = false;
private Handler mHandler = new Handler(){
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
if(msg.what == SEARCH_APP) {
showPackageInfos = packageInfos;
gv.setAdapter(new GridViewAdapter(ShowAppActivity.this,showPackageInfos));
lv.setAdapter(new ListViewAdapter(ShowAppActivity.this,showPackageInfos));
pd.dismiss();
setProgressBarIndeterminateVisibility(false);
}
if(msg.what == DELETE_APP) {
System.out.println("Delete App Success!!");
}
}
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// requestWindowFeature(Window.FEATURE_NO_TITLE);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.show_app_grid);
setProgressBarIndeterminateVisibility(true);
AnimationSet set = new AnimationSet(false);
Animation animation = new AlphaAnimation(0,1);
animation.setDuration(500);
set.addAnimation(animation);
animation = new TranslateAnimation(1, 13, 10, 50);
animation.setDuration(300);
set.addAnimation(animation);
animation = new RotateAnimation(30,10);
animation.setDuration(300);
set.addAnimation(animation);
animation = new ScaleAnimation(5,0,2,0);
animation.setDuration(300);
set.addAnimation(animation);
LayoutAnimationController controller = new LayoutAnimationController(set, 1);
gv = (GridView) this.findViewById(R.id.gv_apps);
gv.setLayoutAnimation(controller);
lv = (ListView)this.findViewById(R.id.lv_apps);
lv.setLayoutAnimation(controller);
lv.setCacheColorHint(0);
gv.setOnItemClickListener(this);
lv.setOnItemClickListener(this);
ib_change_category = (ImageButton) this.findViewById(R.id.ib_change_category);
ib_change_view = (ImageButton) this.findViewById(R.id.ib_change_view);
ib_change_view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if(isListView) {
//Toast.makeText(ShowAppActivity.this, "网格显示", Toast.LENGTH_SHORT).show();
MyToast.myToastShow(ShowAppActivity.this, R.drawable.grids, "网格显示", Toast.LENGTH_SHORT);
ib_change_view.setImageResource(R.drawable.grids);
lv.setVisibility(View.GONE);
gv.setVisibility(View.VISIBLE);
//AlphaAnimation 控制渐变透明的动画效果
//ScaleAnimation 控制尺寸伸缩的动画效果
//TranslateAnimation 控制画面平移的动画效果
//RotateAnimation 控制画面角度变化的动画效果
//LayoutAnimation 渲染ViewGroup中每个View显示时候的动画效果
AnimationSet set = new AnimationSet(false);
Animation animation = new RotateAnimation(60, 0);
animation.setInterpolator(ShowAppActivity.this, android.R.anim.overshoot_interpolator);
animation.setDuration(1000);
set.addAnimation(animation);
animation = new AlphaAnimation(0, 1);
animation.setDuration(500);
set.addAnimation(animation);
gv.startAnimation(set);
//Animation animation = AnimationUtils.loadAnimation(ShowAppActivity.this, R.anim.set1);
//gv.startAnimation(set);
gv.startLayoutAnimation();
isListView = false;
} else {
//Toast.makeText(ShowAppActivity.this, "列表显示", Toast.LENGTH_SHORT).show();
MyToast.myToastShow(ShowAppActivity.this, R.drawable.list, "列表显示", Toast.LENGTH_SHORT);
ib_change_view.setImageResource(R.drawable.list);
gv.setVisibility(View.GONE);
lv.setVisibility(View.VISIBLE);
AnimationSet set = new AnimationSet(false);
Animation animation = new TranslateAnimation(200, 1, 200, 1);
animation.setDuration(500);
animation.setInterpolator(ShowAppActivity.this, android.R.anim.bounce_interpolator);
set.addAnimation(animation);
animation = new ScaleAnimation(0, 1, 0, 1);
animation.setDuration(500);
set.addAnimation(animation);
//Animation animation = AnimationUtils.loadAnimation(ShowAppActivity.this, R.anim.set2);
lv.startAnimation(set);
isListView = true;
}
}
});
ib_change_category.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
if(allApplication) {
ib_change_category.setImageResource(R.drawable.user);
//gv.setAdapter(new GridViewAdapter(ShowAppActivity.this,userPackageInfos));
showPackageInfos = userPackageInfos;
allApplication = false;
//Toast.makeText(ShowAppActivity.this, "用户安装的程序列表", Toast.LENGTH_SHORT).show();
MyToast.myToastShow(ShowAppActivity.this, R.drawable.user, "用户安装的程序列表", Toast.LENGTH_SHORT);
} else {
ib_change_category.setImageResource(R.drawable.all);
//gv.setAdapter(new GridViewAdapter(ShowAppActivity.this,packageInfos));
showPackageInfos = packageInfos;
allApplication = true;
//Toast.makeText(ShowAppActivity.this, "所有程序列表", Toast.LENGTH_SHORT).show();
MyToast.myToastShow(ShowAppActivity.this, R.drawable.all, "所有程序列表", Toast.LENGTH_SHORT);
}
gv.setAdapter(new GridViewAdapter(ShowAppActivity.this,showPackageInfos));
lv.setAdapter(new ListViewAdapter(ShowAppActivity.this,showPackageInfos));
}});
pd = ProgressDialog.show(this, "请稍候...", "正在搜索你所安装的应用程序...",true,false);
Thread t = new Thread(this);
t.start();
}
class GridViewAdapter extends BaseAdapter {
LayoutInflater inflater;
List<PackageInfo> pkInfos;
public GridViewAdapter(Context context,List<PackageInfo> packageInfos) {
i
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Android应用源码之软件管理器-IT计算机-毕业设计.zip (76个子文件)
Android应用源码之软件管理器
软件管理器
AppExplorer
bin
classes.dex 20KB
res
drawable
manage.png 1KB
choose_gridview.png 2KB
modem.png 916B
list.png 1KB
bar.png 232B
button_focus.png 12KB
all.png 2KB
icon.png 3KB
user.png 2KB
bottom_bg.png 339B
choose_listview.png 2KB
line.png 795B
top_bg.png 181B
button.png 11KB
grids.png 2KB
jarlist.cache 120B
dexedLibs
annotations-b8fe4e7e418233f7d0d4621ee82d7924.jar 943B
classes
com
star
explorer
BuildConfig.class 343B
ShowAppActivity$2.class 2KB
R$layout.class 490B
R$id.class 680B
R$drawable.class 830B
ShowAppActivity$ListViewAdapter.class 3KB
ShowAppActivity.class 9KB
ShowAppActivity$3.class 2KB
R$attr.class 337B
ShowAppActivity$1.class 2KB
R.class 616B
R$array.class 390B
ShowAppActivity$GridViewAdapter.class 3KB
ShowAppActivity$4.class 3KB
MyToast.class 1KB
R$string.class 424B
R$anim.class 565B
resources.ap_ 51KB
AppExplorer.apk 63KB
AndroidManifest.xml 687B
res
drawable
manage.png 4KB
choose_gridview.png 4KB
modem.png 4KB
list.png 1KB
bar.png 3KB
button_focus.png 14KB
all.png 5KB
icon.png 3KB
user.png 5KB
bottom_bg.png 3KB
choose_listview.png 5KB
line.png 3KB
top_bg.png 3KB
button.png 17KB
grids.png 4KB
values
strings.xml 363B
anim
set2.xml 625B
translate.xml 319B
scale.xml 248B
layout1.xml 185B
rotate.xml 283B
set1.xml 491B
alpha.xml 203B
layout
show_app_grid.xml 4KB
lv_item.xml 2KB
gv_item.xml 889B
main.xml 382B
gen
com
star
explorer
BuildConfig.java 159B
R.java 3KB
.settings
org.eclipse.jdt.core.prefs 177B
src
com
star
explorer
MyToast.java 1KB
ShowAppActivity.java 14KB
.project 847B
.classpath 475B
project.properties 562B
AndroidManifest.xml 687B
软件管理器的开发_日志.docx 27KB
AppExplorer.apk 62KB
共 76 条
- 1
资源评论
芝麻粒儿
- 粉丝: 6w+
- 资源: 2万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- vscode-1.64.1.tar源码文件
- vscode-1.64.0.tar源码文件
- vscode-1.52.0.tar源码文件
- Music-Player +PlayerActivity+ rockplayer+ SeeJoPlayer 播放器JAVA源码
- vscode-1.46.0.tar源码文件
- 最近很火植物大战僵尸杂交版2.08苹果+安卓+PC+防闪退工具V2+修改工具+高清工具+通关存档整合包更新
- 超级好用的截图工具PixPin,可录制Gif图
- Screenshot_2024-05-21-17-06-42-64_2332cb9b27b851b548ba47a91682926c.jpg
- 毕业设计参考 - 基于树莓派、OpenCV及Python的人脸识别
- node-v18.20.2-linux-arm64
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功