use of android.widget.FrameLayout in project FastDev4Android by jiangqqlmj.
the class BaseQuickAdapter method createIndeterminateProgressView.
/**
* 创建进度条 显示在view的结尾
* @param convertView
* @param parent
* @return
*/
private View createIndeterminateProgressView(View convertView, ViewGroup parent) {
if (convertView == null) {
FrameLayout container = new FrameLayout(context);
container.setForegroundGravity(Gravity.CENTER);
ProgressBar progress = new ProgressBar(context);
container.addView(progress);
convertView = container;
}
return convertView;
}
use of android.widget.FrameLayout in project ToolBarLib by jjhesk.
the class CLayO method inflate.
@Override
public View inflate() {
final View t = ToolbarHelper.generateView(layoutRes.getResourceId(), mContext);
if (layoutRes == LayoutAsset.i_logo_ii) {
ImageView k1 = (ImageView) t.findViewById(R.id.i_kl1);
ImageView k2 = (ImageView) t.findViewById(R.id.i_kr1);
ImageView k3 = (ImageView) t.findViewById(R.id.i_kr2);
ImageView k4 = (ImageView) t.findViewById(R.id.logo_k);
if (topBuilder.getCompanyLogoRes() != 0)
k4.setImageResource(topBuilder.getCompanyLogoRes());
final int[] overrides = topBuilder.getOverrideIcons_i_t_ii();
if (overrides[0] != 0)
k1.setImageResource(overrides[0]);
if (overrides[1] != 0)
k2.setImageResource(overrides[1]);
if (overrides[2] != 0)
k3.setImageResource(overrides[2]);
k1.setOnClickListener(this);
k2.setOnClickListener(this);
k3.setOnClickListener(this);
} else if (layoutRes == LayoutAsset.i_logo_ir) {
ImageView k1 = (ImageView) t.findViewById(R.id.i_kl1);
ImageView k2 = (ImageView) t.findViewById(R.id.i_kr2);
FrameLayout dynamic_button_frame = (FrameLayout) t.findViewById(R.id.liveicon_counterpanel);
ImageView k3 = (ImageView) t.findViewById(R.id.liveiconloc);
ImageView k4 = (ImageView) t.findViewById(R.id.logo_k);
if (topBuilder.getCompanyLogoRes() != 0)
k4.setImageResource(topBuilder.getCompanyLogoRes());
final int[] overrides = topBuilder.getOverrideIcons_i_t_ii();
if (overrides[0] != 0)
k1.setImageResource(overrides[0]);
if (overrides[1] != 0)
k2.setImageResource(overrides[1]);
if (overrides[2] != 0)
k3.setImageResource(overrides[2]);
numberView = (TextView) t.findViewById(R.id.liveicon_text);
k1.setOnClickListener(this);
k2.setOnClickListener(this);
dynamic_button_frame.setOnClickListener(this);
}
return t;
}
use of android.widget.FrameLayout in project ToolBarLib by jjhesk.
the class LiveIcon method initView.
private View initView(final MenuItem item_menu) {
// View vm = ToolbarHelper.generateView(this.layout, n);
item_menu.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
View vm = item_menu.setActionView(this.layout).getActionView();
holder = (TextView) vm.findViewById(R.id.liveicon_text);
image_view = (ImageView) vm.findViewById(R.id.liveiconloc);
if (this.icon != 0) {
this.image_view.setImageResource(this.icon);
}
if (this.holder != null && holder_text != null) {
holder.setText(holder_text);
}
FrameLayout frm = (FrameLayout) vm.findViewById(R.id.liveicon_counterpanel);
frm.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
activity.onOptionsItemSelected(item_menu);
}
});
item_menu.setVisible(true);
return vm;
}
use of android.widget.FrameLayout in project android-viewbadger by jgilfelt.
the class BadgeView method applyTo.
private void applyTo(View target) {
LayoutParams lp = target.getLayoutParams();
ViewParent parent = target.getParent();
FrameLayout container = new FrameLayout(context);
if (target instanceof TabWidget) {
// set target to the relevant tab child container
target = ((TabWidget) target).getChildTabViewAt(targetTabIndex);
this.target = target;
((ViewGroup) target).addView(container, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
this.setVisibility(View.GONE);
container.addView(this);
} else {
// TODO verify that parent is indeed a ViewGroup
ViewGroup group = (ViewGroup) parent;
int index = group.indexOfChild(target);
group.removeView(target);
group.addView(container, index, lp);
container.addView(target);
this.setVisibility(View.GONE);
container.addView(this);
group.invalidate();
}
}
use of android.widget.FrameLayout in project SmartAndroidSource by jaychou2012.
the class PullToRefreshAdapterViewBase method addIndicatorViews.
private void addIndicatorViews() {
Mode mode = getMode();
FrameLayout refreshableViewWrapper = getRefreshableViewWrapper();
if (mode.showHeaderLoadingLayout() && null == mIndicatorIvTop) {
// If the mode can pull down, and we don't have one set already
mIndicatorIvTop = new IndicatorLayout(getContext(), Mode.PULL_FROM_START);
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
params.rightMargin = getResources().getDimensionPixelSize(getResources().getIdentifier("indicator_right_padding", "dimen", context.getPackageName()));
// R.dimen.indicator_right_padding);
params.gravity = Gravity.TOP | Gravity.RIGHT;
refreshableViewWrapper.addView(mIndicatorIvTop, params);
} else if (!mode.showHeaderLoadingLayout() && null != mIndicatorIvTop) {
// If we can't pull down, but have a View then remove it
refreshableViewWrapper.removeView(mIndicatorIvTop);
mIndicatorIvTop = null;
}
if (mode.showFooterLoadingLayout() && null == mIndicatorIvBottom) {
// If the mode can pull down, and we don't have one set already
mIndicatorIvBottom = new IndicatorLayout(getContext(), Mode.PULL_FROM_END);
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
params.rightMargin = getResources().getDimensionPixelSize(getResources().getIdentifier("indicator_right_padding", "dimen", context.getPackageName()));
// R.dimen.indicator_right_padding);
params.gravity = Gravity.BOTTOM | Gravity.RIGHT;
refreshableViewWrapper.addView(mIndicatorIvBottom, params);
} else if (!mode.showFooterLoadingLayout() && null != mIndicatorIvBottom) {
// If we can't pull down, but have a View then remove it
refreshableViewWrapper.removeView(mIndicatorIvBottom);
mIndicatorIvBottom = null;
}
}
Aggregations