Back to project page android_device.
The source code is released under:
[Apache License](http://www.apache.org/licenses/): Version 2.0, January 2004 =============== ## TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION ## ### 1. Definitions. ### "License" sha...
If you think the Android project android_device listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* * ================================================================================================= * Copyright (C) 2014 Martin Albedinsky [Wolf-ITechnologies] * ================================================================================================= * Licensed under the Apache License, Version 2.0 or later (further "License" only). * ------------------------------------------------------------------------------------------------- * You may use this file only in compliance with the License. More details and copy of this License * you may obtain at/* w w w . ja va2 s .com*/ * * http://www.apache.org/licenses/LICENSE-2.0 * * You can redistribute, modify or publish any part of the code written within this file but as it * is described in the License, the software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES or CONDITIONS OF ANY KIND. * * See the License for the specific language governing permissions and limitations under the License. * ================================================================================================= */ package com.wit.android.device.examples.adapter; import android.content.Context; import android.view.View; import android.widget.TextView; import com.wit.android.device.Storage; import com.wit.android.device.examples.R; import com.wit.android.device.examples.model.StorageItem; import com.wit.android.examples.libs.adapter.ExSimpleAdapter; import com.wit.android.examples.libs.adapter.ExViewHolder; import com.wit.android.examples.libs.adapter.annotation.ExItemView; import com.wit.android.examples.libs.adapter.annotation.ExItemViewHolder; import java.util.ArrayList; import java.util.List; /** * todo: description * * @author Martin Albedinsky */ @ExItemView(R.layout.item_list_storage) @ExItemViewHolder(StorageAdapter.Holder.class) public class StorageAdapter extends ExSimpleAdapter<StorageItem> { /** * Log TAG. */ // private static final String TAG = FilesAdapter.class.getSimpleName(); /** * * @param context */ public StorageAdapter(Context context) { super(context); final List<StorageItem> items = new ArrayList<>(6); items.add(StorageItem.create( Storage.ROOT, R.string.Storage_Interface_Label_Root, mResources )); items.add(StorageItem.create( Storage.DATA, R.string.Storage_Interface_Label_Data, mResources )); items.add(StorageItem.create( Storage.CACHE, R.string.Storage_Interface_Label_Cache, mResources )); items.add(StorageItem.create( Storage.INTERNAL, R.string.Storage_Interface_Label_Internal, mResources )); items.add(StorageItem.create( Storage.EXTERNAL, R.string.Storage_Interface_Label_External, mResources )); items.add(StorageItem.create( Storage.EXTERNAL_PACKAGE, R.string.Storage_Interface_Label_External_Package, mResources )); changeItems(items); } /** * */ public static final class Holder implements ExViewHolder<StorageItem, StorageAdapter> { TextView name; /** */ @Override public void create(int position, View view) { this.name = (TextView) view; } /** */ @Override public void bind(int position, StorageItem item, StorageAdapter adapter) { name.setText(item.getName()); } } }