去除无用资源
@ -1,105 +0,0 @@
|
||||
package com.gh.common.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.gh.common.util.DisplayUtils;
|
||||
import com.gh.gamecenter.R;
|
||||
import com.gh.gamecenter.eventbus.EBShowDone;
|
||||
|
||||
import de.greenrobot.event.EventBus;
|
||||
|
||||
public class Gh_LinearLayout extends LinearLayout {
|
||||
|
||||
private LinearLayout dm_item, dm_item_ll_delete;
|
||||
|
||||
private int height;
|
||||
private int total;
|
||||
private int distance;
|
||||
|
||||
private boolean isSliding;
|
||||
|
||||
public boolean isSliding() {
|
||||
return isSliding;
|
||||
}
|
||||
|
||||
private int position;
|
||||
|
||||
Runnable show = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
LayoutParams lparams = new LayoutParams(
|
||||
LayoutParams.MATCH_PARENT, height);
|
||||
lparams.height = dm_item.getHeight() + distance;
|
||||
if (lparams.height > total) {
|
||||
lparams.height = total;
|
||||
}
|
||||
dm_item.setLayoutParams(lparams);
|
||||
invalidate();
|
||||
if (dm_item.getHeight() < total) {
|
||||
postDelayed(show, 10);
|
||||
} else {
|
||||
isSliding = false;
|
||||
EventBus.getDefault().post(new EBShowDone("下载管理", position));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Runnable hide = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
LayoutParams lparams = new LayoutParams(
|
||||
LayoutParams.MATCH_PARENT, height);
|
||||
lparams.height = dm_item.getHeight() - distance;
|
||||
if (lparams.height < height) {
|
||||
lparams.height = height;
|
||||
}
|
||||
dm_item.setLayoutParams(lparams);
|
||||
invalidate();
|
||||
if (dm_item.getHeight() > height) {
|
||||
postDelayed(hide, 10);
|
||||
} else {
|
||||
dm_item_ll_delete.setVisibility(View.GONE);
|
||||
isSliding = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public Gh_LinearLayout(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
|
||||
height = DisplayUtils.dip2px(getContext(), 66);
|
||||
total = DisplayUtils.dip2px(getContext(), 96);
|
||||
distance = DisplayUtils.dip2px(getContext(), 3);
|
||||
|
||||
isSliding = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onAttachedToWindow() {
|
||||
|
||||
super.onAttachedToWindow();
|
||||
dm_item = (LinearLayout) findViewById(R.id.dm_item);
|
||||
dm_item_ll_delete = (LinearLayout) findViewById(R.id.dm_item_ll_delete);
|
||||
}
|
||||
|
||||
public void showDeleteView(int position) {
|
||||
this.position = position;
|
||||
isSliding = true;
|
||||
dm_item_ll_delete.setVisibility(View.VISIBLE);
|
||||
removeCallbacks(hide);
|
||||
post(show);
|
||||
getHandler();
|
||||
}
|
||||
|
||||
public void hideDeleteView() {
|
||||
isSliding = true;
|
||||
removeCallbacks(show);
|
||||
post(hide);
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 469 B |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 970 B |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 242 B |
|
Before Width: | Height: | Size: 232 B |
|
Before Width: | Height: | Size: 278 B |
|
Before Width: | Height: | Size: 490 B |
|
Before Width: | Height: | Size: 966 B |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
@ -1,117 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.gh.common.view.Gh_LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/reuse_listview_item_style"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dm_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="66dp"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dm_item_ll"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="66dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/dm_item_iv_icon"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dm_item_tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/title"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/dm_item_progressbar"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="3dp"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:max="1000"
|
||||
android:progress="500"
|
||||
android:progressDrawable="@drawable/progressbar_bg_style" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dm_item_tv_downloads"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="4"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/content"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dm_item_tv_speed"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="right"
|
||||
android:textColor="@color/content"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dm_item_tv_startorpause"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="27dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:text="下载"
|
||||
android:textColor="@android:color/white"
|
||||
android:background="@drawable/textview_blue_style"
|
||||
android:gravity="center"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dm_item_ll_delete"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:background="@drawable/download_delete"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone" >
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/download_delete_icon" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="3dp"
|
||||
android:text="删除"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</com.gh.common.view.Gh_LinearLayout>
|
||||
@ -1,174 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/theme" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/me_iv_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/me_icon" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/me_iv_icon"
|
||||
android:layout_marginTop="60dp"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/me_ll_concern"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<ImageView
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:src="@drawable/me_concern" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:text="我的关注"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="#22ffffff" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/me_ll_download"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<ImageView
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="5dp"
|
||||
android:src="@drawable/me_download" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/me_tv_download"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@drawable/oval_hint_red_bg"
|
||||
android:gravity="center"
|
||||
android:text="2"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="10sp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:text="下载管理"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="#22ffffff" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/me_ll_update"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<ImageView
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="5dp"
|
||||
android:src="@drawable/me_update" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/me_tv_update"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@drawable/oval_hint_red_bg"
|
||||
android:gravity="center"
|
||||
android:text="2"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="10sp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:text="更新管理"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="#22ffffff" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/me_ll_setting"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<ImageView
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:src="@drawable/me_setting" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:text="设置"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||