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) 2013 - 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/*from w w w .j av a 2s . c o m*/ * * 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.fragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ListView; import com.wit.android.device.AndroidDevice; import com.wit.android.device.Storage; import com.wit.android.device.examples.HomeActivity; import com.wit.android.device.examples.R; import com.wit.android.device.examples.adapter.StorageAdapter; import com.wit.android.device.examples.model.StorageItem; import com.wit.android.examples.libs.fragment.ExListFragment; import com.wit.android.examples.libs.fragment.annotation.ExActionBarOptions; import com.wit.android.examples.libs.widget.ExFrameLayout; /** * <p> * Description. * </p> * * @author Martin Albedinsky */ @ExActionBarOptions(title = R.string.Navigation_Label_StorageInterface) public class StorageInterfaceFragment extends ExListFragment<StorageAdapter> { /** * Log TAG. */ // private static final String TAG = StorageInterfaceFragment.class.getSimpleName(); /** * */ private Storage mStorage; /** */ @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { final StorageItem item = getAdapter().getItem(position); if (item != null) { final HomeActivity homeActivity = (HomeActivity) getActivity(); if (homeActivity != null) { homeActivity.getFragmentController().showFragment( FragmentsFactory.FILES, StorageFilesFragment.createParams( mStorage.getStoragePath(item.getId()) ) ); } } } /** */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.mStorage = AndroidDevice.getInstance(getActivity()).getStorage(); setAdapter(new StorageAdapter(getActivity())); } /** */ @Override protected ViewGroup onCreateLayout(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return new ExFrameLayout(inflater.getContext()); } /** */ @Override protected void onViewCreated(View view, ListView adapterView, Bundle savedInstanceState) { super.onViewCreated(view, adapterView, savedInstanceState); ((HomeActivity) getActivity()).setNavigationVisible(true); } }