use of android.view.View.OnLongClickListener in project android_frameworks_base by AOSPA.
the class LongpressTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
final Longpress a = getActivity();
mSimpleView = a.findViewById(R.id.simple_view);
mSimpleView.setOnLongClickListener(new OnLongClickListener() {
public boolean onLongClick(View v) {
mLongClicked = true;
return true;
}
});
}
use of android.view.View.OnLongClickListener in project android_frameworks_base by AOSPA.
the class DisabledLongpressTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
final Longpress a = getActivity();
mSimpleView = a.findViewById(R.id.simple_view);
mSimpleView.setOnLongClickListener(new OnLongClickListener() {
public boolean onLongClick(View v) {
mLongClicked = true;
return true;
}
});
// The View#setOnLongClickListener will ensure the View is long
// clickable, we reverse that here
mSimpleView.setLongClickable(false);
}
use of android.view.View.OnLongClickListener in project android_frameworks_base by DirtyUnicorns.
the class LongpressTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
final Longpress a = getActivity();
mSimpleView = a.findViewById(R.id.simple_view);
mSimpleView.setOnLongClickListener(new OnLongClickListener() {
public boolean onLongClick(View v) {
mLongClicked = true;
return true;
}
});
}
use of android.view.View.OnLongClickListener in project android_frameworks_base by DirtyUnicorns.
the class DisabledLongpressTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
final Longpress a = getActivity();
mSimpleView = a.findViewById(R.id.simple_view);
mSimpleView.setOnLongClickListener(new OnLongClickListener() {
public boolean onLongClick(View v) {
mLongClicked = true;
return true;
}
});
// The View#setOnLongClickListener will ensure the View is long
// clickable, we reverse that here
mSimpleView.setLongClickable(false);
}
use of android.view.View.OnLongClickListener in project Libraries-for-Android-Developers by eoecn.
the class ListBundleAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup arg2) {
final ListViewHolder viewHolder;
final Bundle ab = list.get(position);
if (convertView == null) {
convertView = mInflater.inflate(R.layout.index_bundle_listview, null);
viewHolder = new ListViewHolder();
viewHolder.imageViewIcon = (ImageView) convertView.findViewById(R.id.image_item_1);
viewHolder.appName = (TextView) convertView.findViewById(R.id.text_item_1);
viewHolder.appinfo = (TextView) convertView.findViewById(R.id.text_item_2);
viewHolder.download = (TextView) convertView.findViewById(R.id.text_item_4);
convertView.setTag(viewHolder);
} else {
viewHolder = (ListViewHolder) convertView.getTag();
}
viewHolder.appName.setText(ab.getName());
viewHolder.appinfo.setText(ab.getVersion());
viewHolder.download.setText("运行");
LinearLayout linearlayout_out_2 = (LinearLayout) convertView.findViewById(R.id.linearlayout_out_2);
linearlayout_out_2.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
if (ab.getState() != ab.ACTIVE) {
//判断插件是否已启动
try {
ab.start();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
if (ab.getBundleActivity() != null) {
//插件设置了启动 Activity
//在宿主应用中我们需要通过 activity启动服务来启动插件的activit
Intent i = new Intent();
i.setClassName(mContext, ab.getBundleActivity());
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(i);
} else {
Toast.makeText(mContext, "该插件没有配置BundleActivity", Toast.LENGTH_SHORT).show();
}
}
});
convertView.setOnLongClickListener(new OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
AlertDialog.Builder alertbBuilder = new AlertDialog.Builder(mContext);
alertbBuilder.setMessage("").setNegativeButton("卸载", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
//直接使用 Bundle.uninstall()卸载
try {
ab.uninstall();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
dialog.cancel();
}
}).create();
alertbBuilder.show();
return false;
}
});
convertView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
//这里调用PullToRefreshWebView2Activity从网络 查询插件demo说明
mContext.startActivity(new Intent(mContext, DetailsActivity.class));
}
});
return convertView;
}
Aggregations