diff options
author | Chris Wren <cwren@android.com> | 2012-09-06 16:46:57 -0400 |
---|---|---|
committer | Chris Wren <cwren@android.com> | 2012-09-07 17:41:42 -0400 |
commit | d85f53c69dead1f1f6c0290b8104422143bc5166 (patch) | |
tree | 2a8d5cec293a0b55937a0a8296ed995f2af39bb8 /src/com/android/dreams/phototable/PhotoTableDreamSettings.java | |
parent | 83fee9012b6d5c5940de5b96fe8d98653ba14c0d (diff) | |
download | android_packages_screensavers_PhotoTable-d85f53c69dead1f1f6c0290b8104422143bc5166.tar.gz android_packages_screensavers_PhotoTable-d85f53c69dead1f1f6c0290b8104422143bc5166.tar.bz2 android_packages_screensavers_PhotoTable-d85f53c69dead1f1f6c0290b8104422143bc5166.zip |
Add ability to select the albums to display.
Change-Id: I80ff33c4c880c445b79735d6483bc9337a89e392
Diffstat (limited to 'src/com/android/dreams/phototable/PhotoTableDreamSettings.java')
-rw-r--r-- | src/com/android/dreams/phototable/PhotoTableDreamSettings.java | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/com/android/dreams/phototable/PhotoTableDreamSettings.java b/src/com/android/dreams/phototable/PhotoTableDreamSettings.java new file mode 100644 index 0000000..e7ba945 --- /dev/null +++ b/src/com/android/dreams/phototable/PhotoTableDreamSettings.java @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.android.dreams.phototable; + +import android.content.SharedPreferences; +import android.app.ListActivity; +import android.os.Bundle; +import android.widget.ArrayAdapter; + +import java.util.LinkedList; + +/** + * Settings panel for photo flipping dream. + */ +public class PhotoTableDreamSettings extends ListActivity { + private static final String TAG = "PhotoTableDreamSettings"; + public static final String PREFS_NAME = PhotoTableDream.TAG; + + private PhotoSourcePlexor mPhotoSource; + private ArrayAdapter<PhotoSource.AlbumData> mAdapter; + private SharedPreferences mSettings; + + @Override + protected void onCreate(Bundle savedInstanceState){ + super.onCreate(savedInstanceState); + + //setContentView(R.layout.custom_list_activity_view); + + mSettings = getSharedPreferences(PREFS_NAME, 0); + + mPhotoSource = new PhotoSourcePlexor(this, mSettings); + mAdapter = new AlbumDataAdapter(this, + mSettings, + R.layout.album, + new LinkedList<PhotoSource.AlbumData>(mPhotoSource.findAlbums())); + mAdapter.sort(new AlbumDataAdapter.RecencyComparator()); + setListAdapter(mAdapter); + } +} |