protected internal override void onCreate(android.os.Bundle savedInstanceState) { base.onCreate(savedInstanceState); android.os.Bundle extras = getIntent().getExtras(); if (extras == null) { finish(); return; } mNumDeletes = extras.getLong("numDeletes"); mAccount = (android.accounts.Account)extras.getParcelable("account"); mAuthority = extras.getString("authority"); mProvider = extras.getString("provider"); // the order of these must match up with the constants for position used in onItemClick java.lang.CharSequence[] options = new java.lang.CharSequence[] { getResources(). getText([email protected][email protected]_really_delete), getResources().getText( [email protected][email protected]_undo_deletes), getResources().getText([email protected] [email protected]_do_nothing) }; android.widget.ListAdapter adapter = new android.widget.ArrayAdapter<java.lang.CharSequence >(this, android.R.layout.simple_list_item_1, android.R.id.text1, options); android.widget.ListView listView = new android.widget.ListView(this); listView.setAdapter(adapter); listView.setItemsCanFocus(true); listView.setOnItemClickListener(this); android.widget.TextView textView = new android.widget.TextView(this); java.lang.CharSequence tooManyDeletesDescFormat = getResources().getText([email protected] [email protected]_too_many_deletes_desc); textView.setText(java.lang.CharSequenceProxy.Wrap(string.Format(tooManyDeletesDescFormat .ToString(), mNumDeletes, mProvider, mAccount.name))); android.widget.LinearLayout ll = new android.widget.LinearLayout(this); ll.setOrientation(android.widget.LinearLayout.VERTICAL); android.widget.LinearLayout.LayoutParams lp = new android.widget.LinearLayout.LayoutParams (android.view.ViewGroup.LayoutParams.MATCH_PARENT, android.view.ViewGroup.LayoutParams .WRAP_CONTENT, 0); ll.addView(textView, lp); ll.addView(listView, lp); // TODO: consider displaying the icon of the account type // AuthenticatorDescription[] descs = AccountManager.get(this).getAuthenticatorTypes(); // for (AuthenticatorDescription desc : descs) { // if (desc.type.equals(mAccount.type)) { // try { // final Context authContext = createPackageContext(desc.packageName, 0); // ImageView imageView = new ImageView(this); // imageView.setImageDrawable(authContext.getResources().getDrawable(desc.iconId)); // ll.addView(imageView, lp); // } catch (PackageManager.NameNotFoundException e) { // } // break; // } // } setContentView(ll); }
public override Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(Activity); LayoutInflater inflater = Activity.LayoutInflater; View view = inflater.inflate(R.layout.dialog_file_list, (ViewGroup)Activity.findViewById(android.R.id.content).RootView, false); ListView listView = (ListView)view.findViewById(R.id.listView1); listView.OnItemClickListener = this; fileAdapter = new FileAdapter(this, Activity); listView.Adapter = fileAdapter; pathTextView = (TextView)view.findViewById(R.id.textViewTitle); pathTextView.OnClickListener = this; okButton = (Button)view.findViewById(R.id.buttonOk); okButton.OnClickListener = this; view.findViewById(R.id.buttonCancel).OnClickListener = this; builder.setView(view).setTitle(getString([email protected])); updateFileList(new File(Environment.ExternalStorageDirectory.AbsolutePath)); return(builder.create()); }
public override void onDestroyView() { mHandler.removeCallbacks(mRequestFocus); mList = null; mListShown = false; mEmptyView = mProgressContainer = mListContainer = null; mStandardEmptyView = null; base.onDestroyView(); }
public void bind(android.widget.ListView arg0) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) { @__env.CallVoidMethod(this.JvmHandle, global::android.preference.PreferenceScreen._bind6962, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)); } else { @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.preference.PreferenceScreen.staticClass, global::android.preference.PreferenceScreen._bind6962, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)); } }
protected override void onListItemClick(android.widget.ListView arg0, android.view.View arg1, int arg2, long arg3) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) { @__env.CallVoidMethod(this.JvmHandle, global::android.app.LauncherActivity._onListItemClick647, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg3)); } else { @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.app.LauncherActivity.staticClass, global::android.app.LauncherActivity._onListItemClick647, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg3)); } }
protected internal override void onCreate(android.os.Bundle savedInstanceState) { base.onCreate(savedInstanceState); android.os.Bundle extras = getIntent().getExtras(); if (extras == null) { finish(); return; } mNumDeletes = extras.getLong("numDeletes"); mAccount = (android.accounts.Account)extras.getParcelable("account"); mAuthority = extras.getString("authority"); mProvider = extras.getString("provider"); // the order of these must match up with the constants for position used in onItemClick java.lang.CharSequence[] options = new java.lang.CharSequence[] { getResources(). getText([email protected][email protected]_really_delete), getResources().getText( [email protected][email protected]_undo_deletes), getResources().getText([email protected] [email protected]_do_nothing) }; android.widget.ListAdapter adapter = new android.widget.ArrayAdapter <java.lang.CharSequence >(this, android.R.layout.simple_list_item_1, android.R.id.text1, options); android.widget.ListView listView = new android.widget.ListView(this); listView.setAdapter(adapter); listView.setItemsCanFocus(true); listView.setOnItemClickListener(this); android.widget.TextView textView = new android.widget.TextView(this); java.lang.CharSequence tooManyDeletesDescFormat = getResources().getText([email protected] [email protected]_too_many_deletes_desc); textView.setText(java.lang.CharSequenceProxy.Wrap(string.Format(tooManyDeletesDescFormat .ToString(), mNumDeletes, mProvider, mAccount.name))); android.widget.LinearLayout ll = new android.widget.LinearLayout(this); ll.setOrientation(android.widget.LinearLayout.VERTICAL); android.widget.LinearLayout.LayoutParams lp = new android.widget.LinearLayout.LayoutParams (android.view.ViewGroup.LayoutParams.MATCH_PARENT, android.view.ViewGroup.LayoutParams .WRAP_CONTENT, 0); ll.addView(textView, lp); ll.addView(listView, lp); // TODO: consider displaying the icon of the account type // AuthenticatorDescription[] descs = AccountManager.get(this).getAuthenticatorTypes(); // for (AuthenticatorDescription desc : descs) { // if (desc.type.equals(mAccount.type)) { // try { // final Context authContext = createPackageContext(desc.packageName, 0); // ImageView imageView = new ImageView(this); // imageView.setImageDrawable(authContext.getResources().getDrawable(desc.iconId)); // ll.addView(imageView, lp); // } catch (PackageManager.NameNotFoundException e) { // } // break; // } // } setContentView(ll); }
protected internal override void onCreate(Bundle savedInstanceState) { base.onCreate(savedInstanceState); ContentView = R.layout.main_activity; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.widget.ListView listActivities = (android.widget.ListView) findViewById(R.id.listview); ListView listActivities = (ListView)findViewById(R.id.listview); string[] activityNames = new string[] { getString([email protected]), getString([email protected]), getString([email protected]), getString([email protected]), getString([email protected]), getString([email protected]), getString([email protected]), getString([email protected]), getString([email protected]), getString([email protected]), getString([email protected]) }; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.widget.ArrayAdapter<String> adapter = new android.widget.ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, activityNames); ArrayAdapter <string> adapter = new ArrayAdapter <string>(this, android.R.layout.simple_list_item_1, activityNames); listActivities.Adapter = adapter; listActivities.OnItemClickListener = new OnItemClickListenerAnonymousInnerClassHelper(this); }
public override void onContentChanged() { base.onContentChanged(); android.view.View emptyView = findViewById([email protected]); mList = (android.widget.ListView)findViewById([email protected]); if (mList == null) { throw new java.lang.RuntimeException("Your content must have a ListView whose id attribute is " + "'android.R.id.list'"); } if (emptyView != null) { mList.setEmptyView(emptyView); } mList.setOnItemClickListener(mOnClickListener); if (mFinishedStart) { setListAdapter(mAdapter); } mHandler.post(mRequestFocus); mFinishedStart = true; }
private void ensureList() { if (mList != null) { return; } android.view.View root = getView(); if (root == null) { throw new System.InvalidOperationException("Content view not yet created"); } if (root is android.widget.ListView) { mList = (android.widget.ListView)root; } else { mStandardEmptyView = (android.widget.TextView)root.findViewById([email protected] .id.internalEmpty); if (mStandardEmptyView == null) { mEmptyView = root.findViewById(android.R.id.empty); } else { mStandardEmptyView.setVisibility(android.view.View.GONE); } mProgressContainer = root.findViewById([email protected]); mListContainer = root.findViewById([email protected]); android.view.View rawListView = root.findViewById(android.R.id.list); if (!(rawListView is android.widget.ListView)) { throw new java.lang.RuntimeException("Content has view with id attribute 'android.R.id.list' " + "that is not a ListView class"); } mList = (android.widget.ListView)rawListView; if (mList == null) { throw new java.lang.RuntimeException("Your content must have a ListView whose id attribute is " + "'android.R.id.list'"); } if (mEmptyView != null) { mList.setEmptyView(mEmptyView); } else { if (mEmptyText != null) { mStandardEmptyView.setText(mEmptyText); mList.setEmptyView(mStandardEmptyView); } } } mListShown = true; mList.setOnItemClickListener(mOnClickListener); if (mAdapter != null) { android.widget.ListAdapter adapter = mAdapter; mAdapter = null; setListAdapter(adapter); } else { // We are starting without an adapter, so assume we won't // have our data right away and start with the progress indicator. if (mProgressContainer != null) { setListShown(false, false); } } mHandler.post(mRequestFocus); }
public override void onDestroyView() { mHandler.removeCallbacks(mRequestFocus); mList = null; mListShown = false; mEmptyView = mProgressContainer = mListContainer = null; mStandardEmptyView = null; base.onDestroyView(); }
public override void onContentChanged() { base.onContentChanged(); android.view.View emptyView = findViewById([email protected]); mList = (android.widget.ListView)findViewById([email protected]); if (mList == null) { throw new java.lang.RuntimeException("Your content must have a ListView whose id attribute is " + "'android.R.id.list'"); } if (emptyView != null) { mList.setEmptyView(emptyView); } mList.setOnItemClickListener(mOnClickListener); if (mFinishedStart) { setListAdapter(mAdapter); } mHandler.post(mRequestFocus); mFinishedStart = true; }
private void ensureList() { if (mList != null) { return; } android.view.View root = getView(); if (root == null) { throw new System.InvalidOperationException("Content view not yet created"); } if (root is android.widget.ListView) { mList = (android.widget.ListView)root; } else { mStandardEmptyView = (android.widget.TextView)root.findViewById([email protected] .id.internalEmpty); if (mStandardEmptyView == null) { mEmptyView = root.findViewById(android.R.id.empty); } else { mStandardEmptyView.setVisibility(android.view.View.GONE); } mProgressContainer = root.findViewById([email protected]); mListContainer = root.findViewById([email protected]); android.view.View rawListView = root.findViewById(android.R.id.list); if (!(rawListView is android.widget.ListView)) { throw new java.lang.RuntimeException("Content has view with id attribute 'android.R.id.list' " + "that is not a ListView class"); } mList = (android.widget.ListView)rawListView; if (mList == null) { throw new java.lang.RuntimeException("Your content must have a ListView whose id attribute is " + "'android.R.id.list'"); } if (mEmptyView != null) { mList.setEmptyView(mEmptyView); } else { if (mEmptyText != null) { mStandardEmptyView.setText(mEmptyText); mList.setEmptyView(mStandardEmptyView); } } } mListShown = true; mList.setOnItemClickListener(mOnClickListener); if (mAdapter != null) { android.widget.ListAdapter adapter = mAdapter; mAdapter = null; setListAdapter(adapter); } else { // We are starting without an adapter, so assume we won't // have our data right away and start with the progress indicator. if (mProgressContainer != null) { setListShown(false, false); } } mHandler.post(mRequestFocus); }
/// <summary>This method will be called when an item in the list is selected.</summary> /// <remarks> /// This method will be called when an item in the list is selected. /// Subclasses should override. Subclasses can call /// getListView().getItemAtPosition(position) if they need to access the /// data associated with the selected item. /// </remarks> /// <param name="l">The ListView where the click happened</param> /// <param name="v">The view that was clicked within the ListView</param> /// <param name="position">The position of the view in the list</param> /// <param name="id">The row id of the item that was clicked</param> public virtual void onListItemClick(android.widget.ListView l, android.view.View v, int position, long id) { }
protected internal override void onListItemClick(android.widget.ListView l, android.view.View v, int position, long id) { throw new System.NotImplementedException(); }
/// <summary>This method will be called when an item in the list is selected.</summary> /// <remarks> /// This method will be called when an item in the list is selected. /// Subclasses should override. Subclasses can call /// getListView().getItemAtPosition(position) if they need to access the /// data associated with the selected item. /// </remarks> /// <param name="l">The ListView where the click happened</param> /// <param name="v">The view that was clicked within the ListView</param> /// <param name="position">The position of the view in the list</param> /// <param name="id">The row id of the item that was clicked</param> protected internal virtual void onListItemClick(android.widget.ListView l, android.view.View v, int position, long id) { }