Fix for selecting a subfilter and having it viewed as selected in Locale. Also, fixed crash in opening number picker

pull/14/head
Tim Su 14 years ago
parent 710e5825db
commit 8600a6a237

@ -17,6 +17,7 @@ import com.flurry.android.FlurryAgent;
import com.timsu.astrid.R; import com.timsu.astrid.R;
import com.todoroo.astrid.adapter.FilterAdapter; import com.todoroo.astrid.adapter.FilterAdapter;
import com.todoroo.astrid.api.Filter; import com.todoroo.astrid.api.Filter;
import com.todoroo.astrid.api.FilterCategory;
import com.todoroo.astrid.api.FilterListItem; import com.todoroo.astrid.api.FilterListItem;
import com.todoroo.astrid.utility.Constants; import com.todoroo.astrid.utility.Constants;
import com.twofortyfouram.SharedResources; import com.twofortyfouram.SharedResources;
@ -146,9 +147,19 @@ public final class LocaleEditAlerts extends ExpandableListActivity {
adapter = new FilterAdapter(this, getExpandableListView(), R.layout.filter_adapter_row) { adapter = new FilterAdapter(this, getExpandableListView(), R.layout.filter_adapter_row) {
@Override @Override
public void onReceiveFilter(FilterListItem item) { public void onReceiveFilter(FilterListItem item) {
if(finalSelection != null && item instanceof Filter && if(adapter.getSelection() != null || finalSelection == null)
finalSelection.equals(((Filter)item).sqlQuery)) return;
adapter.setSelection(item); if(item instanceof Filter) {
if(finalSelection.equals(((Filter)item).sqlQuery))
adapter.setSelection(item);
} else if(item instanceof FilterCategory) {
Filter[] filters = ((FilterCategory)item).children;
for(Filter filter : filters)
if(finalSelection.equals(filter.sqlQuery)) {
adapter.setSelection(filter);
break;
}
}
} }
}; };
adapter.filterStyle = R.style.TextAppearance_LEA_Filter; adapter.filterStyle = R.style.TextAppearance_LEA_Filter;

@ -59,7 +59,7 @@ public class LocaleReceiver extends BroadcastReceiver {
String preferenceKey = makePreferenceKey(title, interval); String preferenceKey = makePreferenceKey(title, interval);
long lastNotifyTime = Preferences.getLong(preferenceKey, 0); long lastNotifyTime = Preferences.getLong(preferenceKey, 0);
if(DateUtilities.now() - lastNotifyTime < interval * 1000L) { if(DateUtilities.now() - lastNotifyTime < interval * 1000L) {
Log.i("astrid-locale", title + ": Too soon, need " + (interval Log.i("astrid-locale-rx", title + ": Too soon, need " + (interval
- (DateUtilities.now() - lastNotifyTime)/1000) + " more seconds"); - (DateUtilities.now() - lastNotifyTime)/1000) + " more seconds");
return; return;
} }
@ -91,8 +91,7 @@ public class LocaleReceiver extends BroadcastReceiver {
} }
} }
} catch (Exception e) { } catch (Exception e) {
if(Constants.DEBUG) Log.i("astrid-locale-rx", "Error receiving intent", e);
Log.i("astrid-locale-rx", "Error receiving intent", e);
} }
} }

@ -18,7 +18,7 @@
--> -->
<merge xmlns:android="http://schemas.android.com/apk/res/android"> <merge xmlns:android="http://schemas.android.com/apk/res/android">
<com.timsu.astrid.widget.NumberPickerButton android:id="@+id/increment" <com.todoroo.astrid.ui.NumberPickerButton android:id="@+id/increment"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/timepicker_up_btn" android:background="@drawable/timepicker_up_btn"
@ -34,7 +34,7 @@
android:background="@drawable/timepicker_input" android:background="@drawable/timepicker_input"
/> />
<com.timsu.astrid.widget.NumberPickerButton android:id="@+id/decrement" <com.todoroo.astrid.ui.NumberPickerButton android:id="@+id/decrement"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/timepicker_down_btn" android:background="@drawable/timepicker_down_btn"

@ -20,7 +20,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="5dip"> android:padding="5dip">
<com.timsu.astrid.widget.NumberPicker android:id="@+id/numberPicker" <com.todoroo.astrid.ui.NumberPicker android:id="@+id/numberPicker"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent"/> android:layout_height="fill_parent"/>
</FrameLayout> </FrameLayout>

Loading…
Cancel
Save