修改共通Dialog实现,去除R文件的依赖,增加常用共通Style
This commit is contained in:
parent
d2f87c19eb
commit
002100768b
|
@ -45,31 +45,6 @@
|
|||
<item name="android:windowExitAnimation">@anim/view_kb_dialog_exit</item>
|
||||
</style>
|
||||
|
||||
<!-- 操作对话框(开始) -->
|
||||
<style name="OperationDialog" parent="@android:style/Theme.Dialog">
|
||||
<item name="android:windowFrame">@null</item><!-- 边框 -->
|
||||
<item name="android:windowNoTitle">true</item><!-- 无标题 -->
|
||||
<item name="android:windowIsTranslucent">false</item><!-- 是否透明 -->
|
||||
<item name="android:windowIsFloating">true</item><!-- 是否浮现在activity之上 -->
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
|
||||
<item name="android:windowBackground">@color/black_80_alpha</item><!-- 自己想要的背景 -->
|
||||
<item name="android:backgroundDimEnabled">true</item><!-- 模糊 -->
|
||||
<item name="android:windowAnimationStyle">@style/dialog_animation</item>
|
||||
</style>
|
||||
<style name="OperationDialogNoAnim" parent="@android:style/Theme.Dialog">
|
||||
<item name="android:windowFrame">@null</item><!-- 边框 -->
|
||||
<item name="android:windowNoTitle">true</item><!-- 无标题 -->
|
||||
<item name="android:windowIsTranslucent">false</item><!-- 是否透明 -->
|
||||
<item name="android:windowIsFloating">true</item><!-- 是否浮现在activity之上 -->
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
|
||||
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
|
||||
<item name="android:windowBackground">@color/black_80_alpha</item><!-- 自己想要的背景 -->
|
||||
<item name="android:backgroundDimEnabled">true</item><!-- 模糊 -->
|
||||
</style>
|
||||
<!-- 操作对话框(结束) -->
|
||||
|
||||
<!-- 自定义dialog特效对话框样式(开始) -->
|
||||
<style name="DialogWindowTitle">
|
||||
<item name="android:textSize">22sp</item>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.zftlive.android.library.widget;
|
||||
|
||||
import java.util.List;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
|
@ -14,13 +15,9 @@ import android.widget.ImageButton;
|
|||
import android.widget.ListView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.zftlive.android.R;
|
||||
import com.zftlive.android.library.base.BaseEntity;
|
||||
import com.zftlive.android.library.base.BaseMAdapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 自定义操作对话框
|
||||
*
|
||||
|
@ -161,15 +158,17 @@ public class OperationDialog extends Dialog {
|
|||
// 查找控件
|
||||
ViewHolder holder = null;
|
||||
if(null == itemView){
|
||||
itemView = LayoutInflater.from(getActivity()).inflate(R.layout.common_operation_dialog_item, parent,false);
|
||||
itemView.setBackgroundResource(R.drawable.selector_common_btn_white_grally_nobold);
|
||||
int mLayoutResId = gainResId(mContext, "layout", "common_operation_dialog_item");
|
||||
int mBgResId = gainResId(mContext, "drawable", "selector_common_btn_white_grally_nobold");
|
||||
itemView = LayoutInflater.from(getActivity()).inflate(mLayoutResId, parent,false);
|
||||
itemView.setBackgroundResource(mBgResId);
|
||||
holder = new ViewHolder();
|
||||
holder.tv_item_ltitle1 = (TextView) itemView.findViewById(R.id.tv_item_ltitle1);
|
||||
holder.tv_item_ltitle2 = (TextView) itemView.findViewById(R.id.tv_item_ltitle2);
|
||||
holder.tv_item_rtitle1 = (TextView) itemView.findViewById(R.id.tv_item_rtitle1);
|
||||
holder.ib_item_right_go = (ImageButton) itemView.findViewById(R.id.ib_item_right_go);
|
||||
holder.ib_item_right_ok = (ImageButton) itemView.findViewById(R.id.ib_item_right_ok);
|
||||
holder.buttom_line = itemView.findViewById(R.id.buttom_line);
|
||||
holder.tv_item_ltitle1 = (TextView) itemView.findViewById(gainResId(mContext, "id", "tv_item_ltitle1"));
|
||||
holder.tv_item_ltitle2 = (TextView) itemView.findViewById(gainResId(mContext, "id", "tv_item_ltitle2"));
|
||||
holder.tv_item_rtitle1 = (TextView) itemView.findViewById(gainResId(mContext, "id", "tv_item_rtitle1"));
|
||||
holder.ib_item_right_go = (ImageButton) itemView.findViewById(gainResId(mContext, "id", "ib_item_right_go"));
|
||||
holder.ib_item_right_ok = (ImageButton) itemView.findViewById(gainResId(mContext, "id", "ib_item_right_ok"));
|
||||
holder.buttom_line = itemView.findViewById(gainResId(mContext, "id", "buttom_line"));
|
||||
//缓存View
|
||||
itemView.setTag(holder);
|
||||
}else {
|
||||
|
|
Loading…
Reference in New Issue