本文整理汇总了C#中Bundle.GetParcelableArrayList方法的典型用法代码示例。如果您正苦于以下问题:C# Bundle.GetParcelableArrayList方法的具体用法?C# Bundle.GetParcelableArrayList怎么用?C# Bundle.GetParcelableArrayList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bundle
的用法示例。
在下文中一共展示了Bundle.GetParcelableArrayList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FromBundle
public static Recipe FromBundle(Bundle bundle) {
var recipe = new Recipe ();
recipe.TitleText = bundle.GetString (Constants.RecipeFieldTitle);
recipe.SummaryText = bundle.GetString (Constants.RecipeFieldSummary);
recipe.RecipeImage = bundle.GetString (Constants.RecipeFieldImage);
recipe.IngredientsText = bundle.GetString (Constants.RecipeFieldIngredients);
var stepBundles = bundle.GetParcelableArrayList (Constants.RecipeFieldSteps);
if (stepBundles != null) {
foreach (IParcelable stepBundle in stepBundles) {
recipe.RecipeSteps.Add (RecipeStep.FromBundle ((Bundle)stepBundle));
}
}
return recipe;
}
示例2: OnViewCreated
public override void OnViewCreated (View view, Bundle savedInstanceState)
{
base.OnViewCreated (view, savedInstanceState);
currentDirectoryTextView = (TextView)view.FindViewById (Resource.Id.textview_current_directory);
nothingInDirectoryTextView = (TextView)view.FindViewById (Resource.Id.textview_nothing_in_directory);
var openPictureButton = (Button)view.FindViewById (Resource.Id.button_open_directory_primary_volume);
openPictureButton.Click += delegate {
string selected = directoriesSpinner.SelectedItem.ToString ();
string directoryName = GetDirectoryName (selected);
Intent intent = storageManager.PrimaryStorageVolume.CreateAccessIntent (directoryName);
StartActivityForResult (intent, OPEN_DIRECTORY_REQUEST_CODE);
};
// Set onClickListener for the external volumes if exists
var containerVolumes = (LinearLayout)Activity.FindViewById (Resource.Id.container_volumes);
foreach (StorageVolume volume in storageManager.StorageVolumes) {
if (volume.IsPrimary) {
// Primary volume area is already added
continue;
}
var volumeArea = (LinearLayout)Activity.LayoutInflater.Inflate (
Resource.Layout.volume_entry, containerVolumes);
var volumeName = (TextView)volumeArea.FindViewById (Resource.Id.textview_volume_name);
volumeName.Text = volume.GetDescription (Activity);
var button = (Button)volumeArea.FindViewById (Resource.Id.button_open_directory);
button.Click += delegate {
string selected = directoriesSpinner.SelectedItem.ToString ();
string directoryName = GetDirectoryName (selected);
Intent intent = volume.CreateAccessIntent (directoryName);
StartActivityForResult (intent, OPEN_DIRECTORY_REQUEST_CODE);
};
}
var recyclerView = (RecyclerView)view.FindViewById (Resource.Id.recyclerview_directory_entries);
if (savedInstanceState != null) {
directoryEntries = (List<DirectoryEntry>)savedInstanceState.GetParcelableArrayList (DIRECTORY_ENTRIES_KEY);
currentDirectoryTextView.Text = savedInstanceState.GetString (SELECTED_DIRECTORY_KEY);
adapter = new DirectoryEntryAdapter (directoryEntries);
if (adapter.ItemCount == 0)
nothingInDirectoryTextView.Visibility = ViewStates.Visible;
} else {
directoryEntries = new List<DirectoryEntry> ();
adapter = new DirectoryEntryAdapter ();
}
recyclerView.SetAdapter (adapter);
recyclerView.SetLayoutManager (new LinearLayoutManager (Activity));
directoriesSpinner = (Spinner)view.FindViewById (Resource.Id.spinner_directories);
var directoriesAdapter = ArrayAdapter.CreateFromResource (Activity, Resource.Array.directories,
Android.Resource.Layout.SimpleSpinnerDropDownItem);
directoriesSpinner.Adapter = directoriesAdapter;
}