Browse Source

Correct look of the preview widget in the widget config screen.

pull/13/merge
Eric Kok 11 years ago
parent
commit
93ee507359
  1. 4
      core/AndroidManifest.xml
  2. 4
      core/res/layout-v11/actionbar_donebutton.xml
  3. 19
      core/res/layout-v11/activity_widgetconfig.xml
  4. 77
      core/res/layout-v11/widget_torrents_dark.xml
  5. 73
      core/res/layout-v11/widget_torrents_light.xml
  6. 2
      core/res/values-sw600dp/dimens.xml
  7. 4
      core/res/values/dimens.xml
  8. 22
      core/res/values/styles.xml
  9. 36
      core/src/org/transdroid/core/widget/WidgetConfigActivity.java
  10. 5
      full/AndroidManifest.xml
  11. 5
      lite/AndroidManifest.xml

4
core/AndroidManifest.xml

@ -17,8 +17,8 @@
--> -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.transdroid.core" package="org.transdroid.core"
android:versionCode="5" android:versionCode="6"
android:versionName="2.0-beta1" > android:versionName="2.0" >
<uses-sdk <uses-sdk
android:minSdkVersion="7" android:minSdkVersion="7"

4
core/res/layout-v11/actionbar_donebutton.xml

@ -18,13 +18,13 @@
--> -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/actionbar_done" android:id="@+id/actionbar_done"
style="?actionButtonStyle" style="?android:actionButtonStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" > android:layout_weight="1" >
<TextView <TextView
style="?actionBarTabTextStyle" style="?android:actionBarTabTextStyle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"

19
core/res/layout-v11/activity_widgetconfig.xml

@ -19,8 +19,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:dividerPadding="@dimen/margin_default" android:dividerPadding="@dimen/margin_default"
android:orientation="@integer/widget_config_orientation" android:orientation="@integer/widget_config_orientation" >
android:padding="@dimen/margin_default" >
<FrameLayout <FrameLayout
android:layout_width="@dimen/widget_preview_width" android:layout_width="@dimen/widget_preview_width"
@ -35,8 +34,10 @@
<ScrollView <ScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/background_light"
android:fillViewport="true" android:fillViewport="true"
android:orientation="vertical" > android:paddingLeft="@dimen/margin_default"
android:paddingRight="@dimen/margin_default" >
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -54,22 +55,26 @@
<Spinner <Spinner
android:id="@+id/server_spinner" android:id="@+id/server_spinner"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_half" />
<Spinner <Spinner
android:id="@+id/filter_spinner" android:id="@+id/filter_spinner"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_default" />
<Spinner <Spinner
android:id="@+id/sort_spinner" android:id="@+id/sort_spinner"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_default" />
<CheckBox <CheckBox
android:id="@+id/reverseorder_check_box" android:id="@+id/reverseorder_check_box"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_half"
android:text="@string/widget_reversesortorder" /> android:text="@string/widget_reversesortorder" />
<TextView <TextView
@ -84,6 +89,8 @@
android:id="@+id/darktheme_check_box" android:id="@+id/darktheme_check_box"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_half"
android:layout_marginTop="@dimen/margin_half"
android:text="@string/widget_usedarktheme" /> android:text="@string/widget_usedarktheme" />
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>

77
core/res/layout-v11/widget_torrents_dark.xml

@ -2,68 +2,83 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/background_dark"
android:padding="@dimen/margin_widget" > android:padding="@dimen/margin_widget" >
<ImageButton <ImageButton
android:id="@+id/icon_image" android:id="@+id/icon_image"
android:layout_width="48dp" android:layout_width="40dp"
android:layout_height="48dp" android:layout_height="40dp"
android:background="@drawable/selectable_background_transdroid2" android:background="@drawable/selectable_background_transdroid"
android:contentDescription="@string/widget_opentransdroid" android:contentDescription="@string/widget_opentransdroid"
android:padding="8dp" android:padding="4dp"
android:src="@drawable/ic_launcher" android:scaleType="fitXY"
android:scaleType="fitXY" /> android:src="@drawable/ic_launcher" />
<include <LinearLayout
android:id="@+id/status_view"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_alignParentRight="true"
layout="@layout/actionbar_serverstatus"
android:background="@drawable/selectable_background_transdroid2" />
<include
android:id="@+id/navigation_view" android:id="@+id/navigation_view"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="40dp"
android:layout_toLeftOf="@id/navigation_view"
android:layout_toRightOf="@id/icon_image" android:layout_toRightOf="@id/icon_image"
layout="@layout/actionbar_navigation" android:background="@drawable/selectable_background_transdroid"
android:background="@color/background_light" /> android:clickable="true"
android:orientation="vertical"
android:paddingTop="2dp"
android:paddingRight="@dimen/margin_half" >
<TextView
android:id="@+id/filter_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-condensed"
android:textColor="@color/text_actionbar_dark"
android:textIsSelectable="false"
android:textSize="@dimen/ui_navigation_filter" />
<TextView
android:id="@+id/server_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-4dip"
android:fontFamily="sans-serif-light"
android:textColor="@color/text_actionbar_dark"
android:textIsSelectable="false"
android:textSize="@dimen/ui_navigation_server" />
</LinearLayout>
<View <View
android:id="@+id/topline_view" android:id="@+id/topline_view"
android:layout_height="2dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_below="@id/icon_image" android:layout_below="@id/icon_image"
android:background="@color/green" /> android:background="@color/green" />
<View <View
android:id="@+id/bottomline_view" android:id="@+id/bottomline_view"
android:layout_height="2dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:background="@color/green" /> android:background="@color/green" />
<com.actionbarsherlock.view.SherlockListView <ListView
android:id="@+id/torrents_list" android:id="@+id/torrents_list"
android:layout_height="wrap_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_below="@id/topline_view" android:layout_height="wrap_content"
android:layout_above="@id/bottomline_view" android:layout_above="@id/bottomline_view"
android:layout_below="@id/topline_view"
android:visibility="gone" /> android:visibility="gone" />
<TextView <TextView
android:id="@+id/error_text" android:id="@+id/error_text"
android:layout_height="wrap_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_below="@id/topline_view" android:layout_height="wrap_content"
android:layout_above="@id/bottomline_view" android:layout_above="@id/bottomline_view"
android:layout_below="@id/topline_view"
android:layout_gravity="center" android:layout_gravity="center"
android:gravity="center" android:gravity="center"
android:maxWidth="400dip" android:maxWidth="400dip"
android:padding="@dimen/margin_default" android:padding="@dimen/margin_default"
android:textIsSelectable="false" android:textIsSelectable="false"
android:visibility="gone" /> android:visibility="gone" />
</RelativeLayout> </RelativeLayout>

73
core/res/layout-v11/widget_torrents_light.xml

@ -2,68 +2,83 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/background_light"
android:padding="@dimen/margin_widget" > android:padding="@dimen/margin_widget" >
<ImageButton <ImageButton
android:id="@+id/icon_image" android:id="@+id/icon_image"
android:layout_width="48dp" android:layout_width="40dp"
android:layout_height="48dp" android:layout_height="40dp"
android:background="@drawable/selectable_background_transdroid2" android:background="@drawable/selectable_background_transdroid2"
android:contentDescription="@string/widget_opentransdroid" android:contentDescription="@string/widget_opentransdroid"
android:padding="8dp" android:padding="4dp"
android:src="@drawable/ic_launcher" android:scaleType="fitXY"
android:scaleType="fitXY" /> android:src="@drawable/ic_launcher" />
<include <LinearLayout
android:id="@+id/status_view"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_alignParentRight="true"
layout="@layout/actionbar_serverstatus"
android:background="@drawable/selectable_background_transdroid2" />
<include
android:id="@+id/navigation_view" android:id="@+id/navigation_view"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="40dp"
android:layout_toLeftOf="@id/navigation_view"
android:layout_toRightOf="@id/icon_image" android:layout_toRightOf="@id/icon_image"
layout="@layout/actionbar_navigation" android:background="@drawable/selectable_background_transdroid2"
android:background="@color/background_light" /> android:clickable="true"
android:orientation="vertical"
android:paddingTop="2dp"
android:paddingRight="@dimen/margin_half" >
<TextView
android:id="@+id/filter_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-condensed"
android:textColor="@color/text_actionbar_light"
android:textIsSelectable="false"
android:textSize="@dimen/ui_navigation_filter" />
<TextView
android:id="@+id/server_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-4dip"
android:fontFamily="sans-serif-light"
android:textColor="@color/text_actionbar_light"
android:textIsSelectable="false"
android:textSize="@dimen/ui_navigation_server" />
</LinearLayout>
<View <View
android:id="@+id/topline_view" android:id="@+id/topline_view"
android:layout_height="2dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_below="@id/icon_image" android:layout_below="@id/icon_image"
android:background="@color/green" /> android:background="@color/green" />
<View <View
android:id="@+id/bottomline_view" android:id="@+id/bottomline_view"
android:layout_height="2dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:background="@color/green" /> android:background="@color/green" />
<ListView <ListView
android:id="@+id/torrents_list" android:id="@+id/torrents_list"
android:layout_height="wrap_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_below="@id/topline_view" android:layout_height="wrap_content"
android:layout_above="@id/bottomline_view" android:layout_above="@id/bottomline_view"
android:layout_below="@id/topline_view"
android:visibility="gone" /> android:visibility="gone" />
<TextView <TextView
android:id="@+id/error_text" android:id="@+id/error_text"
android:layout_height="wrap_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_below="@id/topline_view" android:layout_height="wrap_content"
android:layout_above="@id/bottomline_view" android:layout_above="@id/bottomline_view"
android:layout_below="@id/topline_view"
android:layout_gravity="center" android:layout_gravity="center"
android:gravity="center" android:gravity="center"
android:maxWidth="400dip" android:maxWidth="400dip"
android:padding="@dimen/margin_default" android:padding="@dimen/margin_default"
android:textIsSelectable="false" android:textIsSelectable="false"
android:visibility="gone" /> android:visibility="gone" />
</RelativeLayout> </RelativeLayout>

2
core/res/values-sw600dp/dimens.xml

@ -37,7 +37,7 @@
<!-- Widget configuration --> <!-- Widget configuration -->
<integer name="widget_config_orientation">0</integer> <integer name="widget_config_orientation">0</integer>
<dimen name="widget_preview_padding">15dp</dimen> <dimen name="widget_preview_padding">30dp</dimen>
<dimen name="widget_preview_height">-1dp</dimen> <dimen name="widget_preview_height">-1dp</dimen>
<dimen name="widget_preview_width">300dp</dimen> <dimen name="widget_preview_width">300dp</dimen>

4
core/res/values/dimens.xml

@ -43,8 +43,8 @@
<!-- Widget configuration --> <!-- Widget configuration -->
<integer name="widget_config_orientation">1</integer> <integer name="widget_config_orientation">1</integer>
<dimen name="widget_preview_padding">10dp</dimen> <dimen name="widget_preview_padding">20dp</dimen>
<dimen name="widget_preview_height">150dp</dimen> <dimen name="widget_preview_height">200dp</dimen>
<dimen name="widget_preview_width">-1dp</dimen> <dimen name="widget_preview_width">-1dp</dimen>
</resources> </resources>

22
core/res/values/styles.xml

@ -17,10 +17,10 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"> <resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="TransdroidTheme" parent="Theme.Transdroid.Light"> <style name="TransdroidTheme" parent="Theme.Transdroid.Light">
<!-- All customizations that are NOT specific to a particular API-level can go here. --> <!-- All customizations that are NOT specific to a particular API-level can go here. -->
<item name="android:textViewStyle">@style/DefaultTextView</item> <item name="android:textViewStyle">@style/DefaultTextView</item>
<item name="android:windowBackground">@color/background_light</item> <item name="android:windowBackground">@color/background_light</item>
<item name="ic_action_discard">@drawable/ic_action_discard_light</item> <item name="ic_action_discard">@drawable/ic_action_discard_light</item>
<item name="ic_action_done">@drawable/ic_action_done_light</item> <item name="ic_action_done">@drawable/ic_action_done_light</item>
<item name="ic_action_filter">@drawable/ic_action_filter_light</item> <item name="ic_action_filter">@drawable/ic_action_filter_light</item>
@ -49,10 +49,10 @@
</style> </style>
<style name="TransdroidTheme.Dark" parent="Theme.Transdroid.Dark"> <style name="TransdroidTheme.Dark" parent="Theme.Transdroid.Dark">
<!-- All customizations that are NOT specific to a particular API-level can go here. --> <!-- All customizations that are NOT specific to a particular API-level can go here. -->
<item name="android:textViewStyle">@style/DefaultTextView</item> <item name="android:textViewStyle">@style/DefaultTextView</item>
<item name="android:windowBackground">@color/background_dark</item> <item name="android:windowBackground">@color/background_dark</item>
<item name="ic_action_discard">@drawable/ic_action_discard_dark</item> <item name="ic_action_discard">@drawable/ic_action_discard_dark</item>
<item name="ic_action_done">@drawable/ic_action_done_dark</item> <item name="ic_action_done">@drawable/ic_action_done_dark</item>
<item name="ic_action_filter">@drawable/ic_action_filter_dark</item> <item name="ic_action_filter">@drawable/ic_action_filter_dark</item>
@ -79,7 +79,17 @@
<item name="text_bright">@color/text_bright_dark</item> <item name="text_bright">@color/text_bright_dark</item>
<item name="text_actionbar">@color/text_actionbar_dark</item> <item name="text_actionbar">@color/text_actionbar_dark</item>
</style> </style>
<!-- No theme background to let users wall paper shine through -->
<!-- Inspired by NoNonsenseNotes's ThemeWidgetConfig -->
<style name="TransdroidTheme.WidgetConfig" parent="@style/TransdroidTheme">
<item name="android:background">@null</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowShowWallpaper">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
</style>
<!-- Taken from http://stackoverflow.com/questions/10020466/android-4-0-sub-title-section-label-styling --> <!-- Taken from http://stackoverflow.com/questions/10020466/android-4-0-sub-title-section-label-styling -->
<style name="SectionHeader" parent="android:Widget.Holo.Light.TextView"> <style name="SectionHeader" parent="android:Widget.Holo.Light.TextView">
<item name="android:drawableBottom">@drawable/section_header</item> <item name="android:drawableBottom">@drawable/section_header</item>
@ -103,11 +113,11 @@
<item name="android:paddingTop">2dip</item> <item name="android:paddingTop">2dip</item>
<item name="android:paddingBottom">2dip</item> <item name="android:paddingBottom">2dip</item>
</style> </style>
<style name="BigNumberButton" parent="android:Widget.Holo"> <style name="BigNumberButton" parent="android:Widget.Holo">
<item name="android:background">@drawable/selectable_background_transdroid</item> <item name="android:background">@drawable/selectable_background_transdroid</item>
<item name="android:padding">@dimen/margin_half</item> <item name="android:padding">@dimen/margin_half</item>
<item name="android:textSize">60sp</item> <item name="android:textSize">60sp</item>
</style> </style>
</resources> </resources>

36
core/src/org/transdroid/core/widget/WidgetConfigActivity.java

@ -30,7 +30,6 @@ import org.androidannotations.annotations.ViewById;
import org.transdroid.core.R; import org.transdroid.core.R;
import org.transdroid.core.app.settings.ApplicationSettings; import org.transdroid.core.app.settings.ApplicationSettings;
import org.transdroid.core.app.settings.ServerSetting; import org.transdroid.core.app.settings.ServerSetting;
import org.transdroid.core.app.settings.SystemSettings_;
import org.transdroid.core.gui.lists.SimpleListItem; import org.transdroid.core.gui.lists.SimpleListItem;
import org.transdroid.core.gui.lists.SortByListItem; import org.transdroid.core.gui.lists.SortByListItem;
import org.transdroid.core.gui.lists.TorrentsAdapter; import org.transdroid.core.gui.lists.TorrentsAdapter;
@ -58,12 +57,12 @@ import android.view.View.OnClickListener;
import android.widget.CheckBox; import android.widget.CheckBox;
import android.widget.CompoundButton; import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.ListView;
import android.widget.Spinner; import android.widget.Spinner;
import android.widget.TextView; import android.widget.TextView;
import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockActivity; import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.view.SherlockListView;
@TargetApi(Build.VERSION_CODES.HONEYCOMB) @TargetApi(Build.VERSION_CODES.HONEYCOMB)
@EActivity(resName = "activity_widgetconfig") @EActivity(resName = "activity_widgetconfig")
@ -77,7 +76,7 @@ public class WidgetConfigActivity extends SherlockActivity {
@ViewById @ViewById
protected TextView filterText, serverText, errorText; protected TextView filterText, serverText, errorText;
@ViewById @ViewById
protected SherlockListView torrentsList; protected ListView torrentsList;
@Bean @Bean
protected TorrentsAdapter previewTorrentsAdapter; protected TorrentsAdapter previewTorrentsAdapter;
private List<Torrent> previewTorrents = null; private List<Torrent> previewTorrents = null;
@ -92,25 +91,20 @@ public class WidgetConfigActivity extends SherlockActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
// Set the theme according to the user preference
if (SystemSettings_.getInstance_(this).useDarkTheme()) {
setTheme(R.style.TransdroidTheme_Dark);
getSupportActionBar().setIcon(R.drawable.ic_activity_torrents);
}
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
if (getIntent() == null || getIntent().getExtras() == null
if (getIntent() != null && getIntent().getExtras() != null) { || !getIntent().hasExtra(AppWidgetManager.EXTRA_APPWIDGET_ID)) {
// Get the appwidget ID we are configuring // Invalid configuration; return canceled result
appWidgetId = getIntent().getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, setResult(RESULT_CANCELED,
AppWidgetManager.INVALID_APPWIDGET_ID); new Intent().putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID));
// Set preliminary canceled result and continue with the initialisation finish();
setResult(RESULT_CANCELED, new Intent().putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId));
} }
// Invalid configuration; return canceled result // Get the appwidget ID we are configuring
setResult(RESULT_CANCELED, appWidgetId = getIntent().getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,
new Intent().putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID)); AppWidgetManager.INVALID_APPWIDGET_ID);
finish(); // Set preliminary canceled result and continue with the initialisation
setResult(RESULT_CANCELED, new Intent().putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId));
} }
@ -122,6 +116,7 @@ public class WidgetConfigActivity extends SherlockActivity {
for (TorrentsSortBy order : TorrentsSortBy.values()) { for (TorrentsSortBy order : TorrentsSortBy.values()) {
sortOrders.add(new SortByListItem(order)); sortOrders.add(new SortByListItem(order));
} }
serverSpinner.setAdapter(new FilterListItemAdapter(this, applicationSettings.getServerSettings())); serverSpinner.setAdapter(new FilterListItemAdapter(this, applicationSettings.getServerSettings()));
filterSpinner.setAdapter(new FilterListItemAdapter(this, StatusType.getAllStatusTypes(this))); filterSpinner.setAdapter(new FilterListItemAdapter(this, StatusType.getAllStatusTypes(this)));
sortSpinner.setAdapter(new FilterListItemAdapter(this, sortOrders)); sortSpinner.setAdapter(new FilterListItemAdapter(this, sortOrders));
@ -254,7 +249,8 @@ public class WidgetConfigActivity extends SherlockActivity {
// Return the widget configuration result // Return the widget configuration result
AppWidgetManager manager = AppWidgetManager.getInstance(WidgetConfigActivity.this); AppWidgetManager manager = AppWidgetManager.getInstance(WidgetConfigActivity.this);
manager.updateAppWidget(appWidgetId, WidgetProvider.buildRemoteViews(getApplicationContext(), appWidgetId, config)); manager.updateAppWidget(appWidgetId,
WidgetProvider.buildRemoteViews(getApplicationContext(), appWidgetId, config));
manager.notifyAppWidgetViewDataChanged(appWidgetId, R.id.torrents_list); manager.notifyAppWidgetViewDataChanged(appWidgetId, R.id.torrents_list);
setResult(RESULT_OK, new Intent().putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId)); setResult(RESULT_OK, new Intent().putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId));
finish(); finish();

5
full/AndroidManifest.xml

@ -17,8 +17,8 @@
--> -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.transdroid.full" package="org.transdroid.full"
android:versionCode="5" android:versionCode="6"
android:versionName="2.0-beta1" > android:versionName="2.0" >
<uses-sdk <uses-sdk
android:minSdkVersion="7" android:minSdkVersion="7"
@ -250,6 +250,7 @@
<!-- Home screen widget --> <!-- Home screen widget -->
<activity <activity
android:name="org.transdroid.core.widget.WidgetConfigActivity_" android:name="org.transdroid.core.widget.WidgetConfigActivity_"
android:theme="@style/TransdroidTheme.WidgetConfig"
android:enabled="@bool/widget_available" > android:enabled="@bool/widget_available" >
<intent-filter> <intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" /> <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />

5
lite/AndroidManifest.xml

@ -17,8 +17,8 @@
--> -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.transdroid.lite" package="org.transdroid.lite"
android:versionCode="5" android:versionCode="6"
android:versionName="2.0-beta1" > android:versionName="2.0" >
<uses-sdk <uses-sdk
android:minSdkVersion="7" android:minSdkVersion="7"
@ -217,6 +217,7 @@
<receiver <receiver
android:name="org.transdroid.core.widget.WidgetProvider_" android:name="org.transdroid.core.widget.WidgetProvider_"
android:theme="@style/TransdroidTheme.WidgetConfig"
android:enabled="@bool/widget_available" > android:enabled="@bool/widget_available" >
<intent-filter> <intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />

Loading…
Cancel
Save