seperated how and what into diffrent activitys
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<attribute name="javadoc_location" value="http://tcdevsvn1/ShyHookdocumentation"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" path="LocationLib_src"/>
|
||||
<classpathentry kind="src" path="ExceptionHandlerLib_src"/>
|
||||
<classpathentry kind="src" path="LocationLib_src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.TwentyCodes.android.LocationRinger"
|
||||
android:installLocation="internalOnly" android:versionName="1.0" android:versionCode="18">
|
||||
android:installLocation="internalOnly" android:versionName="1.0" android:versionCode="20">
|
||||
<uses-sdk android:minSdkVersion="7" />
|
||||
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
|
||||
@@ -18,14 +18,14 @@
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
|
||||
|
||||
<application android:icon="@drawable/icon" android:label="@string/app_name">
|
||||
<activity android:label="@string/app_name" android:name="LocationRinger" android:configChanges="keyboard|orientation">
|
||||
<activity android:label="@string/app_name" android:configChanges="keyboard|orientation" android:name="LocationRinger">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<uses-library android:name="com.google.android.maps"/>
|
||||
<activity android:name=".ui.RingerInformationActivity" android:configChanges="keyboard|orientation"></activity>
|
||||
<activity android:name=".ui.WhatActivity" android:configChanges="keyboard|orientation"></activity>
|
||||
<receiver android:name=".receivers.SystemReceiver" android:enabled="true" android:exported="true" android:process=":SysyemEventReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED"></action>
|
||||
@@ -49,5 +49,6 @@
|
||||
</receiver>
|
||||
<activity android:name="com.TwentyCodes.android.exception.ExceptionReportActivity" android:configChanges="keyboard|orientation"></activity>
|
||||
<activity android:name="com.TwentyCodes.android.SkyHook.Splash" android:screenOrientation="portrait" android:configChanges="keyboard|orientation"></activity>
|
||||
<activity android:name=".ui.HowActivity"></activity>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -6,10 +6,11 @@
|
||||
|
||||
|
||||
# The following is for using our custom server based exception handler web application
|
||||
# HTTP ONLY
|
||||
# server is the physical web address for your server
|
||||
# file is the path to your filing script
|
||||
# get is the path to your json retrieval script
|
||||
server = http://powers.doesntexist.com:666/
|
||||
server = http://powers.doesntexist.com:666
|
||||
file = /index.php?post=1
|
||||
#get = /index.php?get=1
|
||||
|
||||
|
||||
@@ -30,65 +30,69 @@ public final class R {
|
||||
public static final int skyhook_logo_alpha_small=0x7f020007;
|
||||
public static final int statusbar_icon=0x7f020008;
|
||||
public static final int tc_logo_complete=0x7f020009;
|
||||
public static final int user=0x7f02000a;
|
||||
public static final int user_arrow_animation_1=0x7f02000a;
|
||||
public static final int user_arrow_animation_2=0x7f02000b;
|
||||
public static final int user_arrow_animation_3=0x7f02000c;
|
||||
public static final int userarrow=0x7f02000d;
|
||||
}
|
||||
public static final class id {
|
||||
public static final int add_a_feature_label=0x7f070029;
|
||||
public static final int add_feature_button=0x7f07002a;
|
||||
public static final int add_ringer_button=0x7f070030;
|
||||
public static final int add_ringer_button_hint=0x7f070032;
|
||||
public static final int add_a_feature_label=0x7f070038;
|
||||
public static final int add_feature_button=0x7f07001d;
|
||||
public static final int add_ringer_button=0x7f070024;
|
||||
public static final int add_ringer_button_hint=0x7f070026;
|
||||
public static final int address=0x7f070002;
|
||||
public static final int address_list=0x7f070003;
|
||||
public static final int alarm_volume=0x7f070004;
|
||||
public static final int alarm_volume_info=0x7f070023;
|
||||
public static final int bluetooth_toggle=0x7f070026;
|
||||
public static final int buttons=0x7f07001a;
|
||||
public static final int data_label=0x7f070024;
|
||||
public static final int alarm_volume_info=0x7f070033;
|
||||
public static final int bluetooth_toggle=0x7f070036;
|
||||
public static final int buttons=0x7f07000d;
|
||||
public static final int data_label=0x7f070034;
|
||||
public static final int description=0x7f070006;
|
||||
public static final int exception_text=0x7f070008;
|
||||
public static final int exception_title=0x7f070007;
|
||||
public static final int info=0x7f07001f;
|
||||
public static final int map_controls=0x7f07000e;
|
||||
public static final int map_edit_toggle=0x7f07000f;
|
||||
public static final int map_info=0x7f070028;
|
||||
public static final int map_mode=0x7f07002e;
|
||||
public static final int mapview=0x7f070011;
|
||||
public static final int mark_my_location=0x7f07002c;
|
||||
public static final int info=0x7f07002f;
|
||||
public static final int map_controls=0x7f070011;
|
||||
public static final int map_edit_toggle=0x7f070012;
|
||||
public static final int map_info=0x7f07000f;
|
||||
public static final int map_mode=0x7f070021;
|
||||
public static final int mapview=0x7f070014;
|
||||
public static final int mark_my_location=0x7f07001f;
|
||||
public static final int msg=0x7f07000a;
|
||||
public static final int msg_scrollview=0x7f070009;
|
||||
public static final int music_volume=0x7f070012;
|
||||
public static final int music_volume_info=0x7f070022;
|
||||
public static final int my_location=0x7f07002d;
|
||||
public static final int notification_ringtone=0x7f070015;
|
||||
public static final int notification_ringtone_button=0x7f070014;
|
||||
public static final int notification_ringtone_info=0x7f070021;
|
||||
public static final int notification_ringtone_volume=0x7f070016;
|
||||
public static final int notification_silent_toggle=0x7f070013;
|
||||
public static final int music_volume=0x7f070015;
|
||||
public static final int music_volume_info=0x7f070032;
|
||||
public static final int my_location=0x7f070020;
|
||||
public static final int notification_ringtone=0x7f070018;
|
||||
public static final int notification_ringtone_button=0x7f070017;
|
||||
public static final int notification_ringtone_info=0x7f070031;
|
||||
public static final int notification_ringtone_volume=0x7f070019;
|
||||
public static final int notification_silent_toggle=0x7f070016;
|
||||
public static final int ok=0x7f070001;
|
||||
public static final int ok_button=0x7f07000b;
|
||||
public static final int radius=0x7f070010;
|
||||
public static final int ringer_enabled_checkbox=0x7f07000d;
|
||||
public static final int ringer_list=0x7f070031;
|
||||
public static final int ringer_name=0x7f07001e;
|
||||
public static final int ringer_options=0x7f07001c;
|
||||
public static final int ringer_toggle=0x7f07001d;
|
||||
public static final int ringtone=0x7f070035;
|
||||
public static final int ringtone_button=0x7f070034;
|
||||
public static final int ringtone_info=0x7f070020;
|
||||
public static final int ringtone_silent_toggle=0x7f070033;
|
||||
public static final int ringtone_volume=0x7f070036;
|
||||
public static final int save_ringer_button=0x7f07002b;
|
||||
public static final int scrollview=0x7f07001b;
|
||||
public static final int search=0x7f07002f;
|
||||
public static final int radius=0x7f070013;
|
||||
public static final int ringer_enabled_checkbox=0x7f070010;
|
||||
public static final int ringer_list=0x7f070025;
|
||||
public static final int ringer_name=0x7f07002e;
|
||||
public static final int ringer_options=0x7f07002c;
|
||||
public static final int ringer_toggle=0x7f07002d;
|
||||
public static final int ringerinfpager=0x7f070023;
|
||||
public static final int ringtone=0x7f070029;
|
||||
public static final int ringtone_button=0x7f070028;
|
||||
public static final int ringtone_info=0x7f070030;
|
||||
public static final int ringtone_silent_toggle=0x7f070027;
|
||||
public static final int ringtone_volume=0x7f07002a;
|
||||
public static final int save_ringer_button=0x7f07001e;
|
||||
public static final int scrollview=0x7f07000e;
|
||||
public static final int search=0x7f070022;
|
||||
public static final int search_progress=0x7f070000;
|
||||
public static final int send=0x7f070005;
|
||||
public static final int skyhook_img=0x7f070017;
|
||||
public static final int tc_img=0x7f070019;
|
||||
public static final int text=0x7f070018;
|
||||
public static final int update_interval=0x7f070037;
|
||||
public static final int update_interval_info=0x7f070027;
|
||||
public static final int skyhook_img=0x7f07001a;
|
||||
public static final int tc_img=0x7f07001c;
|
||||
public static final int text=0x7f07001b;
|
||||
public static final int update_interval=0x7f07002b;
|
||||
public static final int update_interval_info=0x7f070037;
|
||||
public static final int widget_get_location_button=0x7f07000c;
|
||||
public static final int wifi_toggle=0x7f070025;
|
||||
public static final int wifi_toggle=0x7f070035;
|
||||
}
|
||||
public static final class layout {
|
||||
public static final int address_dialog=0x7f030000;
|
||||
@@ -97,18 +101,20 @@ public final class R {
|
||||
public static final int exception_list_item=0x7f030003;
|
||||
public static final int first_boot_dialog=0x7f030004;
|
||||
public static final int get_location_widget=0x7f030005;
|
||||
public static final int list_item=0x7f030006;
|
||||
public static final int map_info=0x7f030007;
|
||||
public static final int music_volume=0x7f030008;
|
||||
public static final int notification_ringtone=0x7f030009;
|
||||
public static final int powered_by_skyhook=0x7f03000a;
|
||||
public static final int report_list_activity=0x7f03000b;
|
||||
public static final int ringer_info=0x7f03000c;
|
||||
public static final int how=0x7f030006;
|
||||
public static final int list_item=0x7f030007;
|
||||
public static final int map_info=0x7f030008;
|
||||
public static final int music_volume=0x7f030009;
|
||||
public static final int notification_ringtone=0x7f03000a;
|
||||
public static final int powered_by_skyhook=0x7f03000b;
|
||||
public static final int report_list_activity=0x7f03000c;
|
||||
public static final int ringer_info_button_bar=0x7f03000d;
|
||||
public static final int ringer_list=0x7f03000e;
|
||||
public static final int ringtone=0x7f03000f;
|
||||
public static final int simple_list_item=0x7f030010;
|
||||
public static final int update_interval=0x7f030011;
|
||||
public static final int ringer_information=0x7f03000e;
|
||||
public static final int ringer_list=0x7f03000f;
|
||||
public static final int ringtone=0x7f030010;
|
||||
public static final int simple_list_item=0x7f030011;
|
||||
public static final int update_interval=0x7f030012;
|
||||
public static final int what=0x7f030013;
|
||||
}
|
||||
public static final class string {
|
||||
public static final int about=0x7f050020;
|
||||
|
||||
@@ -30,65 +30,69 @@ public final class R {
|
||||
public static final int skyhook_logo_alpha_small=0x7f020007;
|
||||
public static final int statusbar_icon=0x7f020008;
|
||||
public static final int tc_logo_complete=0x7f020009;
|
||||
public static final int user=0x7f02000a;
|
||||
public static final int user_arrow_animation_1=0x7f02000a;
|
||||
public static final int user_arrow_animation_2=0x7f02000b;
|
||||
public static final int user_arrow_animation_3=0x7f02000c;
|
||||
public static final int userarrow=0x7f02000d;
|
||||
}
|
||||
public static final class id {
|
||||
public static final int add_a_feature_label=0x7f070029;
|
||||
public static final int add_feature_button=0x7f07002a;
|
||||
public static final int add_ringer_button=0x7f070030;
|
||||
public static final int add_ringer_button_hint=0x7f070032;
|
||||
public static final int add_a_feature_label=0x7f070038;
|
||||
public static final int add_feature_button=0x7f07001d;
|
||||
public static final int add_ringer_button=0x7f070024;
|
||||
public static final int add_ringer_button_hint=0x7f070026;
|
||||
public static final int address=0x7f070002;
|
||||
public static final int address_list=0x7f070003;
|
||||
public static final int alarm_volume=0x7f070004;
|
||||
public static final int alarm_volume_info=0x7f070023;
|
||||
public static final int bluetooth_toggle=0x7f070026;
|
||||
public static final int buttons=0x7f07001a;
|
||||
public static final int data_label=0x7f070024;
|
||||
public static final int alarm_volume_info=0x7f070033;
|
||||
public static final int bluetooth_toggle=0x7f070036;
|
||||
public static final int buttons=0x7f07000d;
|
||||
public static final int data_label=0x7f070034;
|
||||
public static final int description=0x7f070006;
|
||||
public static final int exception_text=0x7f070008;
|
||||
public static final int exception_title=0x7f070007;
|
||||
public static final int info=0x7f07001f;
|
||||
public static final int map_controls=0x7f07000e;
|
||||
public static final int map_edit_toggle=0x7f07000f;
|
||||
public static final int map_info=0x7f070028;
|
||||
public static final int map_mode=0x7f07002e;
|
||||
public static final int mapview=0x7f070011;
|
||||
public static final int mark_my_location=0x7f07002c;
|
||||
public static final int info=0x7f07002f;
|
||||
public static final int map_controls=0x7f070011;
|
||||
public static final int map_edit_toggle=0x7f070012;
|
||||
public static final int map_info=0x7f07000f;
|
||||
public static final int map_mode=0x7f070021;
|
||||
public static final int mapview=0x7f070014;
|
||||
public static final int mark_my_location=0x7f07001f;
|
||||
public static final int msg=0x7f07000a;
|
||||
public static final int msg_scrollview=0x7f070009;
|
||||
public static final int music_volume=0x7f070012;
|
||||
public static final int music_volume_info=0x7f070022;
|
||||
public static final int my_location=0x7f07002d;
|
||||
public static final int notification_ringtone=0x7f070015;
|
||||
public static final int notification_ringtone_button=0x7f070014;
|
||||
public static final int notification_ringtone_info=0x7f070021;
|
||||
public static final int notification_ringtone_volume=0x7f070016;
|
||||
public static final int notification_silent_toggle=0x7f070013;
|
||||
public static final int music_volume=0x7f070015;
|
||||
public static final int music_volume_info=0x7f070032;
|
||||
public static final int my_location=0x7f070020;
|
||||
public static final int notification_ringtone=0x7f070018;
|
||||
public static final int notification_ringtone_button=0x7f070017;
|
||||
public static final int notification_ringtone_info=0x7f070031;
|
||||
public static final int notification_ringtone_volume=0x7f070019;
|
||||
public static final int notification_silent_toggle=0x7f070016;
|
||||
public static final int ok=0x7f070001;
|
||||
public static final int ok_button=0x7f07000b;
|
||||
public static final int radius=0x7f070010;
|
||||
public static final int ringer_enabled_checkbox=0x7f07000d;
|
||||
public static final int ringer_list=0x7f070031;
|
||||
public static final int ringer_name=0x7f07001e;
|
||||
public static final int ringer_options=0x7f07001c;
|
||||
public static final int ringer_toggle=0x7f07001d;
|
||||
public static final int ringtone=0x7f070035;
|
||||
public static final int ringtone_button=0x7f070034;
|
||||
public static final int ringtone_info=0x7f070020;
|
||||
public static final int ringtone_silent_toggle=0x7f070033;
|
||||
public static final int ringtone_volume=0x7f070036;
|
||||
public static final int save_ringer_button=0x7f07002b;
|
||||
public static final int scrollview=0x7f07001b;
|
||||
public static final int search=0x7f07002f;
|
||||
public static final int radius=0x7f070013;
|
||||
public static final int ringer_enabled_checkbox=0x7f070010;
|
||||
public static final int ringer_list=0x7f070025;
|
||||
public static final int ringer_name=0x7f07002e;
|
||||
public static final int ringer_options=0x7f07002c;
|
||||
public static final int ringer_toggle=0x7f07002d;
|
||||
public static final int ringerinfpager=0x7f070023;
|
||||
public static final int ringtone=0x7f070029;
|
||||
public static final int ringtone_button=0x7f070028;
|
||||
public static final int ringtone_info=0x7f070030;
|
||||
public static final int ringtone_silent_toggle=0x7f070027;
|
||||
public static final int ringtone_volume=0x7f07002a;
|
||||
public static final int save_ringer_button=0x7f07001e;
|
||||
public static final int scrollview=0x7f07000e;
|
||||
public static final int search=0x7f070022;
|
||||
public static final int search_progress=0x7f070000;
|
||||
public static final int send=0x7f070005;
|
||||
public static final int skyhook_img=0x7f070017;
|
||||
public static final int tc_img=0x7f070019;
|
||||
public static final int text=0x7f070018;
|
||||
public static final int update_interval=0x7f070037;
|
||||
public static final int update_interval_info=0x7f070027;
|
||||
public static final int skyhook_img=0x7f07001a;
|
||||
public static final int tc_img=0x7f07001c;
|
||||
public static final int text=0x7f07001b;
|
||||
public static final int update_interval=0x7f07002b;
|
||||
public static final int update_interval_info=0x7f070037;
|
||||
public static final int widget_get_location_button=0x7f07000c;
|
||||
public static final int wifi_toggle=0x7f070025;
|
||||
public static final int wifi_toggle=0x7f070035;
|
||||
}
|
||||
public static final class layout {
|
||||
public static final int address_dialog=0x7f030000;
|
||||
@@ -97,18 +101,20 @@ public final class R {
|
||||
public static final int exception_list_item=0x7f030003;
|
||||
public static final int first_boot_dialog=0x7f030004;
|
||||
public static final int get_location_widget=0x7f030005;
|
||||
public static final int list_item=0x7f030006;
|
||||
public static final int map_info=0x7f030007;
|
||||
public static final int music_volume=0x7f030008;
|
||||
public static final int notification_ringtone=0x7f030009;
|
||||
public static final int powered_by_skyhook=0x7f03000a;
|
||||
public static final int report_list_activity=0x7f03000b;
|
||||
public static final int ringer_info=0x7f03000c;
|
||||
public static final int how=0x7f030006;
|
||||
public static final int list_item=0x7f030007;
|
||||
public static final int map_info=0x7f030008;
|
||||
public static final int music_volume=0x7f030009;
|
||||
public static final int notification_ringtone=0x7f03000a;
|
||||
public static final int powered_by_skyhook=0x7f03000b;
|
||||
public static final int report_list_activity=0x7f03000c;
|
||||
public static final int ringer_info_button_bar=0x7f03000d;
|
||||
public static final int ringer_list=0x7f03000e;
|
||||
public static final int ringtone=0x7f03000f;
|
||||
public static final int simple_list_item=0x7f030010;
|
||||
public static final int update_interval=0x7f030011;
|
||||
public static final int ringer_information=0x7f03000e;
|
||||
public static final int ringer_list=0x7f03000f;
|
||||
public static final int ringtone=0x7f030010;
|
||||
public static final int simple_list_item=0x7f030011;
|
||||
public static final int update_interval=0x7f030012;
|
||||
public static final int what=0x7f030013;
|
||||
}
|
||||
public static final class string {
|
||||
public static final int about=0x7f050020;
|
||||
|
||||
@@ -30,65 +30,69 @@ public final class R {
|
||||
public static final int skyhook_logo_alpha_small=0x7f020007;
|
||||
public static final int statusbar_icon=0x7f020008;
|
||||
public static final int tc_logo_complete=0x7f020009;
|
||||
public static final int user=0x7f02000a;
|
||||
public static final int user_arrow_animation_1=0x7f02000a;
|
||||
public static final int user_arrow_animation_2=0x7f02000b;
|
||||
public static final int user_arrow_animation_3=0x7f02000c;
|
||||
public static final int userarrow=0x7f02000d;
|
||||
}
|
||||
public static final class id {
|
||||
public static final int add_a_feature_label=0x7f070029;
|
||||
public static final int add_feature_button=0x7f07002a;
|
||||
public static final int add_ringer_button=0x7f070030;
|
||||
public static final int add_ringer_button_hint=0x7f070032;
|
||||
public static final int add_a_feature_label=0x7f070038;
|
||||
public static final int add_feature_button=0x7f07001d;
|
||||
public static final int add_ringer_button=0x7f070024;
|
||||
public static final int add_ringer_button_hint=0x7f070026;
|
||||
public static final int address=0x7f070002;
|
||||
public static final int address_list=0x7f070003;
|
||||
public static final int alarm_volume=0x7f070004;
|
||||
public static final int alarm_volume_info=0x7f070023;
|
||||
public static final int bluetooth_toggle=0x7f070026;
|
||||
public static final int buttons=0x7f07001a;
|
||||
public static final int data_label=0x7f070024;
|
||||
public static final int alarm_volume_info=0x7f070033;
|
||||
public static final int bluetooth_toggle=0x7f070036;
|
||||
public static final int buttons=0x7f07000d;
|
||||
public static final int data_label=0x7f070034;
|
||||
public static final int description=0x7f070006;
|
||||
public static final int exception_text=0x7f070008;
|
||||
public static final int exception_title=0x7f070007;
|
||||
public static final int info=0x7f07001f;
|
||||
public static final int map_controls=0x7f07000e;
|
||||
public static final int map_edit_toggle=0x7f07000f;
|
||||
public static final int map_info=0x7f070028;
|
||||
public static final int map_mode=0x7f07002e;
|
||||
public static final int mapview=0x7f070011;
|
||||
public static final int mark_my_location=0x7f07002c;
|
||||
public static final int info=0x7f07002f;
|
||||
public static final int map_controls=0x7f070011;
|
||||
public static final int map_edit_toggle=0x7f070012;
|
||||
public static final int map_info=0x7f07000f;
|
||||
public static final int map_mode=0x7f070021;
|
||||
public static final int mapview=0x7f070014;
|
||||
public static final int mark_my_location=0x7f07001f;
|
||||
public static final int msg=0x7f07000a;
|
||||
public static final int msg_scrollview=0x7f070009;
|
||||
public static final int music_volume=0x7f070012;
|
||||
public static final int music_volume_info=0x7f070022;
|
||||
public static final int my_location=0x7f07002d;
|
||||
public static final int notification_ringtone=0x7f070015;
|
||||
public static final int notification_ringtone_button=0x7f070014;
|
||||
public static final int notification_ringtone_info=0x7f070021;
|
||||
public static final int notification_ringtone_volume=0x7f070016;
|
||||
public static final int notification_silent_toggle=0x7f070013;
|
||||
public static final int music_volume=0x7f070015;
|
||||
public static final int music_volume_info=0x7f070032;
|
||||
public static final int my_location=0x7f070020;
|
||||
public static final int notification_ringtone=0x7f070018;
|
||||
public static final int notification_ringtone_button=0x7f070017;
|
||||
public static final int notification_ringtone_info=0x7f070031;
|
||||
public static final int notification_ringtone_volume=0x7f070019;
|
||||
public static final int notification_silent_toggle=0x7f070016;
|
||||
public static final int ok=0x7f070001;
|
||||
public static final int ok_button=0x7f07000b;
|
||||
public static final int radius=0x7f070010;
|
||||
public static final int ringer_enabled_checkbox=0x7f07000d;
|
||||
public static final int ringer_list=0x7f070031;
|
||||
public static final int ringer_name=0x7f07001e;
|
||||
public static final int ringer_options=0x7f07001c;
|
||||
public static final int ringer_toggle=0x7f07001d;
|
||||
public static final int ringtone=0x7f070035;
|
||||
public static final int ringtone_button=0x7f070034;
|
||||
public static final int ringtone_info=0x7f070020;
|
||||
public static final int ringtone_silent_toggle=0x7f070033;
|
||||
public static final int ringtone_volume=0x7f070036;
|
||||
public static final int save_ringer_button=0x7f07002b;
|
||||
public static final int scrollview=0x7f07001b;
|
||||
public static final int search=0x7f07002f;
|
||||
public static final int radius=0x7f070013;
|
||||
public static final int ringer_enabled_checkbox=0x7f070010;
|
||||
public static final int ringer_list=0x7f070025;
|
||||
public static final int ringer_name=0x7f07002e;
|
||||
public static final int ringer_options=0x7f07002c;
|
||||
public static final int ringer_toggle=0x7f07002d;
|
||||
public static final int ringerinfpager=0x7f070023;
|
||||
public static final int ringtone=0x7f070029;
|
||||
public static final int ringtone_button=0x7f070028;
|
||||
public static final int ringtone_info=0x7f070030;
|
||||
public static final int ringtone_silent_toggle=0x7f070027;
|
||||
public static final int ringtone_volume=0x7f07002a;
|
||||
public static final int save_ringer_button=0x7f07001e;
|
||||
public static final int scrollview=0x7f07000e;
|
||||
public static final int search=0x7f070022;
|
||||
public static final int search_progress=0x7f070000;
|
||||
public static final int send=0x7f070005;
|
||||
public static final int skyhook_img=0x7f070017;
|
||||
public static final int tc_img=0x7f070019;
|
||||
public static final int text=0x7f070018;
|
||||
public static final int update_interval=0x7f070037;
|
||||
public static final int update_interval_info=0x7f070027;
|
||||
public static final int skyhook_img=0x7f07001a;
|
||||
public static final int tc_img=0x7f07001c;
|
||||
public static final int text=0x7f07001b;
|
||||
public static final int update_interval=0x7f07002b;
|
||||
public static final int update_interval_info=0x7f070037;
|
||||
public static final int widget_get_location_button=0x7f07000c;
|
||||
public static final int wifi_toggle=0x7f070025;
|
||||
public static final int wifi_toggle=0x7f070035;
|
||||
}
|
||||
public static final class layout {
|
||||
public static final int address_dialog=0x7f030000;
|
||||
@@ -97,18 +101,20 @@ public final class R {
|
||||
public static final int exception_list_item=0x7f030003;
|
||||
public static final int first_boot_dialog=0x7f030004;
|
||||
public static final int get_location_widget=0x7f030005;
|
||||
public static final int list_item=0x7f030006;
|
||||
public static final int map_info=0x7f030007;
|
||||
public static final int music_volume=0x7f030008;
|
||||
public static final int notification_ringtone=0x7f030009;
|
||||
public static final int powered_by_skyhook=0x7f03000a;
|
||||
public static final int report_list_activity=0x7f03000b;
|
||||
public static final int ringer_info=0x7f03000c;
|
||||
public static final int how=0x7f030006;
|
||||
public static final int list_item=0x7f030007;
|
||||
public static final int map_info=0x7f030008;
|
||||
public static final int music_volume=0x7f030009;
|
||||
public static final int notification_ringtone=0x7f03000a;
|
||||
public static final int powered_by_skyhook=0x7f03000b;
|
||||
public static final int report_list_activity=0x7f03000c;
|
||||
public static final int ringer_info_button_bar=0x7f03000d;
|
||||
public static final int ringer_list=0x7f03000e;
|
||||
public static final int ringtone=0x7f03000f;
|
||||
public static final int simple_list_item=0x7f030010;
|
||||
public static final int update_interval=0x7f030011;
|
||||
public static final int ringer_information=0x7f03000e;
|
||||
public static final int ringer_list=0x7f03000f;
|
||||
public static final int ringtone=0x7f030010;
|
||||
public static final int simple_list_item=0x7f030011;
|
||||
public static final int update_interval=0x7f030012;
|
||||
public static final int what=0x7f030013;
|
||||
}
|
||||
public static final class string {
|
||||
public static final int about=0x7f050020;
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
android:hint="@string/address"
|
||||
android:id="@+id/address"
|
||||
android:layout_toLeftOf="@id/ok"
|
||||
/>
|
||||
android:inputType="textPostalAddress"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
44
LocationRinger/res/layout/how.xml
Normal file
44
LocationRinger/res/layout/how.xml
Normal file
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<!-- buttons -->
|
||||
|
||||
<include
|
||||
android:id="@+id/buttons"
|
||||
layout="@layout/ringer_info_button_bar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"/>
|
||||
|
||||
|
||||
<com.TwentyCodes.android.LocationRinger.ui.ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:id="@+id/scrollview"
|
||||
android:layout_above="@id/buttons"
|
||||
>
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
>
|
||||
|
||||
<!-- Location Options -->
|
||||
|
||||
<include android:id="@+id/map_info"
|
||||
layout="@layout/map_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="350dip"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginLeft="10dip"
|
||||
android:layout_marginRight="10dip"/>
|
||||
|
||||
</RelativeLayout>
|
||||
</com.TwentyCodes.android.LocationRinger.ui.ScrollView>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -51,7 +51,7 @@
|
||||
android:id="@+id/mapview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:apiKey="0rKmsWMM0D-K15bEM_kwabPbNhsn4dp4rcq2q5Q"
|
||||
android:apiKey="0rKmsWMM0D-KC9KXr1WbA5aEb-2ozQ0SHTvV46g"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_below="@id/map_controls"
|
||||
/>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
android:id="@+id/notification_ringtone"
|
||||
android:editable="false"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content" android:cursorVisible="false"/>
|
||||
|
||||
<TextView
|
||||
android:text="@string/volume"
|
||||
|
||||
17
LocationRinger/res/layout/ringer_information.xml
Normal file
17
LocationRinger/res/layout/ringer_information.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<android.support.v4.view.ViewPager
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/ringerinfpager">
|
||||
|
||||
</android.support.v4.view.ViewPager>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@@ -42,7 +42,7 @@
|
||||
android:id="@+id/ringtone"
|
||||
android:editable="false"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content" android:cursorVisible="false"/>
|
||||
|
||||
<TextView
|
||||
android:text="@string/volume"
|
||||
|
||||
@@ -26,10 +26,11 @@
|
||||
android:id="@+id/scrollview"
|
||||
>
|
||||
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:id="@+id/ringer_options"
|
||||
android:layout_alignParentTop="true"
|
||||
@@ -142,18 +143,8 @@
|
||||
android:visibility="gone"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Location Options -->
|
||||
|
||||
<include android:id="@+id/map_info"
|
||||
layout="@layout/map_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="350dip"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_below="@id/info"
|
||||
android:layout_marginLeft="10dip"
|
||||
android:layout_marginRight="10dip"/>
|
||||
</RelativeLayout>
|
||||
</com.TwentyCodes.android.LocationRinger.ui.ScrollView>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -8,14 +8,14 @@ package com.TwentyCodes.android.LocationRinger;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.TwentyCodes.android.LocationRinger.ui.RingerListActivity;
|
||||
import com.TwentyCodes.android.LocationRinger.ui.ListActivity;
|
||||
import com.TwentyCodes.android.exception.ExceptionHandler;
|
||||
|
||||
/**
|
||||
* This is the main Activity for Location Ringer
|
||||
* @author ricky barrette
|
||||
*/
|
||||
public class LocationRinger extends RingerListActivity {
|
||||
public class LocationRinger extends ListActivity {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
@@ -47,7 +47,7 @@ public class RingerDatabase {
|
||||
/*
|
||||
* database information values
|
||||
*/
|
||||
private final int DATABASE_VERSION = 3;
|
||||
private final int DATABASE_VERSION = 4;
|
||||
|
||||
/*
|
||||
* the following is for the table that holds the other table names
|
||||
@@ -58,15 +58,15 @@ public class RingerDatabase {
|
||||
/*
|
||||
* Database keys
|
||||
*/
|
||||
public final static String KEY_RADIUS = "radius";
|
||||
public final static String KEY_LOCATION_LAT = "location_lat";
|
||||
public final static String KEY_LOCATION_LON = "location_lon";
|
||||
public final static String KEY_RINGER_NAME = "ringer_name";
|
||||
public final static String KEY_RINGTONE = "home_ringtone";
|
||||
public final static String KEY_NOTIFICATION_RINGTONE = "notification_ringtone";
|
||||
public final static String KEY_RINGTONE_IS_SILENT = "ringtone_is_silent";
|
||||
public final static String KEY_NOTIFICATION_IS_SILENT = "notification_is_silent";
|
||||
public final static String KEY_IS_ENABLED = "is_enabled";
|
||||
public final static String KEY_RADIUS = "radius";
|
||||
public final static String KEY_LOCATION_LAT = "location_lat";
|
||||
public final static String KEY_LOCATION_LON = "location_lon";
|
||||
public final static String KEY_RINGTONE_URI = "ringtone_uri";
|
||||
public final static String KEY_NOTIFICATION_RINGTONE_URI = "away_notification_uri";
|
||||
public final static String KEY_RINGTONE_VOLUME = "ringtone_volume";
|
||||
@@ -165,10 +165,7 @@ private class OpenHelper extends SQLiteOpenHelper {
|
||||
db.execSQL("CREATE TABLE " + RINGER_TABLE +
|
||||
"(id INTEGER PRIMARY KEY, " +
|
||||
KEY_RINGER_NAME+" TEXT, " +
|
||||
KEY_IS_ENABLED+" TEXT, " +
|
||||
KEY_RADIUS+" INTEGER, " +
|
||||
KEY_LOCATION_LAT+" INTEGER, " +
|
||||
KEY_LOCATION_LON+" INTEGER)");
|
||||
KEY_IS_ENABLED+" TEXT)");
|
||||
db.execSQL("CREATE TABLE " + RINGER_INFO_TABLE +
|
||||
"(id INTEGER PRIMARY KEY, " +
|
||||
KEY_RINGER_NAME+" TEXT, " +
|
||||
@@ -232,6 +229,31 @@ private class OpenHelper extends SQLiteOpenHelper {
|
||||
convert2to3(db);
|
||||
//remove old tables
|
||||
db.execSQL("DROP TABLE IF EXISTS two");
|
||||
case 3:
|
||||
Cursor c = db.query(RINGER_TABLE, new String[] { "id", KEY_RINGER_NAME, KEY_LOCATION_LAT, KEY_LOCATION_LON, KEY_RADIUS }, null, null, null, null, null);;
|
||||
c.moveToFirst();
|
||||
if (c.moveToFirst()) {
|
||||
do {
|
||||
if(Debug.DEBUG)
|
||||
Log.d(TAG, "Moving: "+c.getInt(0)+" "+c.getString(1)+" "+c.getInt(2)+", "+c.getInt(3)+" @ "+ c.getInt(4) +"m");
|
||||
ContentValues ringer = new ContentValues();
|
||||
ContentValues info = new ContentValues();
|
||||
ringer.put(KEY_RINGER_NAME, c.getString(1));
|
||||
info.put(KEY_LOCATION_LAT, c.getInt(2));
|
||||
info.put(KEY_LOCATION_LON, c.getInt(3));
|
||||
info.put(KEY_RADIUS, c.getInt(4));
|
||||
updateRinger(c.getInt(0), ringer, info);
|
||||
} while (c.moveToNext());
|
||||
}
|
||||
//drop old location trigger information
|
||||
db.execSQL("CREATE TABLE ringers_new (" +
|
||||
"id INTEGER PRIMARY KEY, " +
|
||||
KEY_RINGER_NAME+" TEXT, " +
|
||||
KEY_IS_ENABLED+" TEXT)");
|
||||
db.execSQL("INSERT INTO ringers_new SELECT id, "+ KEY_RINGER_NAME +", "+ KEY_IS_ENABLED +" FROM "+RINGER_TABLE);
|
||||
db.execSQL("DROP TABLE "+ RINGER_TABLE);
|
||||
db.execSQL("ALTER TABLE ringers_new RENAME TO "+ RINGER_TABLE);
|
||||
|
||||
}
|
||||
handler.sendEmptyMessage(0);
|
||||
RingerDatabase.this.isUpgrading = false;
|
||||
@@ -380,7 +402,7 @@ private class OpenHelper extends SQLiteOpenHelper {
|
||||
* @author ricky barrette
|
||||
*/
|
||||
public Cursor getAllRingers(){
|
||||
return this.mDb.query(RINGER_TABLE, new String[] { KEY_RINGER_NAME, KEY_IS_ENABLED, KEY_RADIUS, KEY_LOCATION_LAT, KEY_LOCATION_LON }, null, null, null, null, null);
|
||||
return this.mDb.query(RINGER_TABLE, new String[] { KEY_RINGER_NAME, KEY_IS_ENABLED }, null, null, null, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -409,7 +431,7 @@ private class OpenHelper extends SQLiteOpenHelper {
|
||||
* @author ricky barrette
|
||||
*/
|
||||
public Cursor getRingerFromId(long id) {
|
||||
return this.mDb.query(RINGER_TABLE, new String[]{ KEY_RINGER_NAME, KEY_IS_ENABLED, KEY_RADIUS, KEY_LOCATION_LAT, KEY_LOCATION_LON }, "id = "+id, null, null, null, null);
|
||||
return this.mDb.query(RINGER_TABLE, new String[]{ KEY_RINGER_NAME, KEY_IS_ENABLED }, "id = "+id, null, null, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -418,9 +440,18 @@ private class OpenHelper extends SQLiteOpenHelper {
|
||||
* @return
|
||||
* @author ricky barrette
|
||||
*/
|
||||
public Cursor getRingerInfo(String ringerName){
|
||||
return this.mDb.query(RINGER_INFO_TABLE,
|
||||
new String[]{ KEY, KEY_VALUE }, KEY_RINGER_NAME +" = "+ DatabaseUtils.sqlEscapeString(ringerName), null, null, null, null);
|
||||
public ContentValues getRingerInfo(String ringerName){
|
||||
ContentValues values = new ContentValues();
|
||||
Cursor info = this.mDb.query(RINGER_INFO_TABLE, new String[]{ KEY, KEY_VALUE }, KEY_RINGER_NAME +" = "+ DatabaseUtils.sqlEscapeString(ringerName), null, null, null, null);
|
||||
if (info.moveToFirst()) {
|
||||
do {
|
||||
values.put(info.getString(0), info.getString(1));
|
||||
} while (info.moveToNext());
|
||||
}
|
||||
if (info != null && !info.isClosed()) {
|
||||
info.close();
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -540,7 +571,11 @@ private class OpenHelper extends SQLiteOpenHelper {
|
||||
* @param info values
|
||||
* @author ricky barrette
|
||||
*/
|
||||
public void updateRinger(long id, ContentValues ringer, ContentValues info){
|
||||
public void updateRinger(long id, ContentValues ringer, ContentValues info) throws NullPointerException{
|
||||
|
||||
if(ringer == null || info == null)
|
||||
throw new NullPointerException("ringer content was null");
|
||||
|
||||
String ringer_name = getRingerName(id);
|
||||
|
||||
if(!ringer_name.equals(ringer.getAsString(RingerDatabase.KEY_RINGER_NAME)))
|
||||
|
||||
@@ -326,16 +326,19 @@ public class RingerProcessingService extends Service {
|
||||
if (c.moveToFirst()) {
|
||||
do {
|
||||
if(Debug.DEBUG)
|
||||
Log.d(TAG, "Checking ringer "+c.getString(0)+" "+c.getInt(3)+", "+c.getInt(4)+" @ "+ c.getInt(2) +"m");
|
||||
Log.d(TAG, "Checking ringer "+c.getString(0));
|
||||
|
||||
if(RingerDatabase.parseBoolean(c.getString(1)))
|
||||
if(GeoUtils.isIntersecting(point, new Float(mLocation.getAccuracy()) / 1000, new GeoPoint(c.getInt(3), c.getInt(4)), new Float(c.getInt(2)) / 1000, Debug.FUDGE_FACTOR)){
|
||||
if(RingerDatabase.parseBoolean(c.getString(1))){
|
||||
ContentValues info = this.mDb.getRingerInfo(c.getString(0));
|
||||
if(info.containsKey(RingerDatabase.KEY_LOCATION_LAT) && info.containsKey(RingerDatabase.KEY_LOCATION_LON) && info.containsKey(RingerDatabase.KEY_RADIUS))
|
||||
if(GeoUtils.isIntersecting(point, new Float(mLocation.getAccuracy()) / 1000, new GeoPoint(info.getAsInteger(RingerDatabase.KEY_LOCATION_LAT), info.getAsInteger(RingerDatabase.KEY_LOCATION_LON)), new Float(info.getAsInteger(RingerDatabase.KEY_RADIUS)) / 1000, Debug.FUDGE_FACTOR)){
|
||||
c.close();
|
||||
getRinger(ringer, index);
|
||||
isDeafult = false;
|
||||
//break loop, we will only apply the first applicable ringer
|
||||
break;
|
||||
}
|
||||
}
|
||||
index++;
|
||||
} while (c.moveToNext());
|
||||
}
|
||||
@@ -363,22 +366,13 @@ public class RingerProcessingService extends Service {
|
||||
* @return
|
||||
*/
|
||||
private ContentValues getRinger(ContentValues values, long id) {
|
||||
|
||||
String name = this.mDb.getRingerName(id);
|
||||
values.put(RingerDatabase.KEY_RINGER_NAME, name);
|
||||
|
||||
/*
|
||||
* get the ringer's info, and parse it into content values
|
||||
*/
|
||||
Cursor c = this.mDb.getRingerInfo(name);
|
||||
if (c.moveToFirst()) {
|
||||
do {
|
||||
values.put(c.getString(0), c.getString(1));
|
||||
} while (c.moveToNext());
|
||||
}
|
||||
if (c != null && !c.isClosed()) {
|
||||
c.close();
|
||||
}
|
||||
values.putAll(this.mDb.getRingerInfo(name));
|
||||
return values;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,369 @@
|
||||
/**
|
||||
* RingerInformationHowActivity.java
|
||||
* @date Jul 29, 2011
|
||||
* @author Twenty Codes, LLC
|
||||
* @author ricky barrette
|
||||
*/
|
||||
package com.TwentyCodes.android.LocationRinger.ui;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.CompoundButton.OnCheckedChangeListener;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.SeekBar.OnSeekBarChangeListener;
|
||||
import android.widget.Toast;
|
||||
import android.widget.ToggleButton;
|
||||
|
||||
import com.TwentyCodes.android.LocationRinger.LocationSelectedListener;
|
||||
import com.TwentyCodes.android.LocationRinger.R;
|
||||
import com.TwentyCodes.android.LocationRinger.db.RingerDatabase;
|
||||
import com.TwentyCodes.android.LocationRinger.debug.Debug;
|
||||
import com.TwentyCodes.android.SkyHook.SkyHook;
|
||||
import com.TwentyCodes.android.location.GeoPointLocationListener;
|
||||
import com.TwentyCodes.android.location.MapView;
|
||||
import com.google.android.maps.GeoPoint;
|
||||
|
||||
/**
|
||||
* This activity will allow users to pick how a ringer works. Using this activity they will pick triggers for this ringer
|
||||
* @author ricky
|
||||
*/
|
||||
public class HowActivity extends com.google.android.maps.MapActivity implements LocationSelectedListener, GeoPointLocationListener, OnClickListener, OnCheckedChangeListener, OnSeekBarChangeListener {
|
||||
|
||||
private static final String TAG = "RingerInformationHowActivity";
|
||||
private static final int ADD_ID = 1;
|
||||
private static final int WHAT_REQUEST_CODE = 467468436;
|
||||
private SeekBar mRadius;
|
||||
private MapView mMapView;
|
||||
private ToggleButton mMapEditToggle;
|
||||
private RadiusOverlay mRadiusOverlay;
|
||||
private GeoPoint mPoint;
|
||||
private SkyHook mSkyHook;
|
||||
private ProgressDialog mGpsProgress;
|
||||
private boolean isFirstFix;
|
||||
private ScrollView mScrollView;
|
||||
|
||||
@Override
|
||||
protected boolean isRouteDisplayed() {
|
||||
//UNUSED
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the HOW activity finishes, this will just pass the results back to the ringer list activity
|
||||
*/
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if(resultCode == RESULT_OK){
|
||||
this.setResult(RESULT_OK, data);
|
||||
this.finish();
|
||||
}
|
||||
//don show for default
|
||||
if(this.getIntent().getBooleanExtra(ListActivity.KEY_IS_DEFAULT, false))
|
||||
this.finish();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a toggle button's state is changed
|
||||
* @author ricky barrette
|
||||
*/
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
switch(buttonView.getId()){
|
||||
|
||||
case R.id.map_edit_toggle:
|
||||
this.isFirstFix = isChecked;
|
||||
|
||||
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,
|
||||
isChecked
|
||||
? (this.getResources().getDisplayMetrics().heightPixels - findViewById(R.id.map_controls).getHeight())
|
||||
: (int) (TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 350, getResources().getDisplayMetrics())));
|
||||
if(isChecked){
|
||||
this.mSkyHook.getUpdates();
|
||||
params.addRule(RelativeLayout.ALIGN_PARENT_TOP );
|
||||
this.mGpsProgress = ProgressDialog.show(this, "", this.getText(R.string.gps_fix), true, true);
|
||||
} else {
|
||||
this.mSkyHook.removeUpdates();
|
||||
params.addRule(RelativeLayout.BELOW, R.id.info);
|
||||
params.addRule(RelativeLayout.ALIGN_BOTTOM );
|
||||
if(this.mGpsProgress != null)
|
||||
this.mGpsProgress.dismiss();
|
||||
}
|
||||
findViewById(R.id.map_info).setLayoutParams(params );
|
||||
|
||||
this.mMapView.setDoubleTapZoonEnabled(isChecked);
|
||||
//buttons
|
||||
findViewById(R.id.mark_my_location).setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||
findViewById(R.id.my_location).setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||
findViewById(R.id.map_mode).setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||
findViewById(R.id.search).setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||
findViewById(R.id.add_feature_button).setVisibility(isChecked ? View.GONE : View.VISIBLE);
|
||||
this.mScrollView.invalidate();
|
||||
this.mScrollView.setScrollEnabled(! isChecked);
|
||||
this.mMapView.setBuiltInZoomControls(isChecked);
|
||||
this.mMapView.setClickable(isChecked);
|
||||
this.mRadius.setEnabled(isChecked);
|
||||
Toast.makeText(this, isChecked ? getString(R.string.map_editing_enabled) : getString(R.string.map_editiing_disabled), Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a view is clicked
|
||||
* @author ricky barrette
|
||||
*/
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()){
|
||||
case R.id.mark_my_location:
|
||||
if(this.mPoint != null){
|
||||
this.mRadiusOverlay.setLocation(mPoint);
|
||||
this.mMapView.getController().setCenter(mPoint);
|
||||
}
|
||||
break;
|
||||
case R.id.my_location:
|
||||
if(this.mPoint != null)
|
||||
this.mMapView.getController().setCenter(mPoint);
|
||||
break;
|
||||
case R.id.map_mode:
|
||||
this.mMapView.setSatellite(mMapView.isSatellite() ? false : true);
|
||||
break;
|
||||
case R.id.search:
|
||||
new SearchDialog(this, this).show();
|
||||
break;
|
||||
case R.id.add_feature_button:
|
||||
Toast.makeText(this, "NO TRIGGERS YET", Toast.LENGTH_LONG).show();
|
||||
break;
|
||||
case R.id.save_ringer_button:
|
||||
save();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the acivity is first created
|
||||
* @author ricky barrette
|
||||
*/
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
this.setContentView(R.layout.how);
|
||||
|
||||
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
|
||||
|
||||
this.mSkyHook = new SkyHook(this);
|
||||
this.mSkyHook.setLocationListener(this);
|
||||
|
||||
this.mScrollView = (ScrollView) findViewById(R.id.scrollview);
|
||||
|
||||
this.mMapView = (MapView) findViewById(R.id.mapview);
|
||||
this.mRadius = (SeekBar) findViewById(R.id.radius);
|
||||
this.mRadius.setMax(Debug.MAX_RADIUS_IN_METERS);
|
||||
this.mMapView.setClickable(false);
|
||||
this.mMapEditToggle = (ToggleButton) findViewById(R.id.map_edit_toggle);
|
||||
this.mMapEditToggle.setChecked(false);
|
||||
this.mMapEditToggle.setOnCheckedChangeListener(this);
|
||||
this.mRadiusOverlay = new RadiusOverlay();
|
||||
this.mRadius.setOnSeekBarChangeListener(this);
|
||||
this.mMapView.getOverlays().add(mRadiusOverlay);
|
||||
this.mRadius.setEnabled(false);
|
||||
|
||||
findViewById(R.id.mark_my_location).setOnClickListener(this);
|
||||
findViewById(R.id.my_location).setOnClickListener(this);
|
||||
findViewById(R.id.map_mode).setOnClickListener(this);
|
||||
findViewById(R.id.search).setOnClickListener(this);
|
||||
findViewById(R.id.save_ringer_button).setOnClickListener(this);
|
||||
findViewById(R.id.add_feature_button).setOnClickListener(this);
|
||||
|
||||
|
||||
Intent data = this.getIntent();
|
||||
|
||||
this.setTitle(getString(R.string.editing)+" "+data.getStringExtra(RingerDatabase.KEY_RINGER_NAME));
|
||||
|
||||
if(data.hasExtra(ListActivity.KEY_INFO)){
|
||||
/*
|
||||
* We need to null check all the values
|
||||
*/
|
||||
ContentValues info = (ContentValues) data.getParcelableExtra(ListActivity.KEY_INFO);
|
||||
|
||||
if (info.get(RingerDatabase.KEY_LOCATION_LAT) != null && info.get(RingerDatabase.KEY_LOCATION_LON) != null){
|
||||
this.mRadiusOverlay.setLocation(new GeoPoint(info.getAsInteger(RingerDatabase.KEY_LOCATION_LAT), info.getAsInteger(RingerDatabase.KEY_LOCATION_LON)));
|
||||
}
|
||||
|
||||
if (info.get(RingerDatabase.KEY_RADIUS) != null){
|
||||
this.mRadius.setProgress(info.getAsInteger(RingerDatabase.KEY_RADIUS));
|
||||
}
|
||||
|
||||
if(data.getBooleanExtra(ListActivity.KEY_IS_DEFAULT, false)){
|
||||
this.startActivityForResult(new Intent(this, WhatActivity.class).putExtras(this.getIntent()), WHAT_REQUEST_CODE);
|
||||
}
|
||||
} else
|
||||
this.setTitle(R.string.new_ringer);
|
||||
|
||||
if(this.mRadiusOverlay.getLocation() != null){
|
||||
this.mMapView.getController().setCenter(this.mRadiusOverlay.getLocation());
|
||||
this.mMapView.getController().setZoom(16);
|
||||
}
|
||||
|
||||
|
||||
this.mMapView.setDoubleTapZoonEnabled(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the main menu that is displayed when the menu button is clicked
|
||||
* @author ricky barrette
|
||||
*/
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
menu.add(0, ADD_ID, 0, getString(R.string.add_feature)).setIcon(android.R.drawable.ic_menu_add);
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.google.android.maps.MapActivity#onDestroy()
|
||||
* @author ricky barrette
|
||||
*/
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
this.mSkyHook.removeUpdates();
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when skyhook has a location to report
|
||||
* @author ricky barrette
|
||||
*/
|
||||
@Override
|
||||
public void onLocationChanged(GeoPoint point, int accuracy) {
|
||||
this.mPoint = point;
|
||||
|
||||
if(point != null){
|
||||
|
||||
/*
|
||||
* if this is the first fix and the radius overlay does not have a point specified
|
||||
* then pan the map, and zoom in to the users current location
|
||||
*/
|
||||
if(this.isFirstFix)
|
||||
if(this.mRadiusOverlay.getLocation() == null){
|
||||
if(this.mMapView != null){
|
||||
this.mMapView.getController().setCenter(point);
|
||||
this.mMapView.getController().setZoom((this.mMapView.getMaxZoomLevel() - 5));
|
||||
}
|
||||
this.isFirstFix = false;
|
||||
}
|
||||
|
||||
/*
|
||||
* dismiss the acquiring gps dialog
|
||||
*/
|
||||
if(this.mGpsProgress != null)
|
||||
this.mGpsProgress.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
@Override
|
||||
public void onLocationSelected(GeoPoint point) {
|
||||
if(point != null){
|
||||
if(Debug.DEBUG)
|
||||
Log.d(TAG, "onLocationSelected() "+ point.toString());
|
||||
|
||||
if(this.mRadiusOverlay != null)
|
||||
this.mRadiusOverlay.setLocation(point);
|
||||
|
||||
if(this.mMapView != null){
|
||||
this.mMapView.getController().setCenter(point);
|
||||
this.mMapView.getController().setZoom((this.mMapView.getMaxZoomLevel() - 5));
|
||||
}
|
||||
} else if(Debug.DEBUG)
|
||||
Log.d(TAG, "onLocationSelected() Location was null");
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see android.app.Activity#onOptionsItemSelected(android.view.MenuItem)
|
||||
* @author ricky barrette
|
||||
*/
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch(item.getItemId()){
|
||||
case ADD_ID:
|
||||
//TODO display triggers
|
||||
break;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a seekbar is has its progress changed
|
||||
* @author ricky barrette
|
||||
*/
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||
switch (seekBar.getId()){
|
||||
case R.id.radius:
|
||||
this.mRadiusOverlay.setRadius(progress);
|
||||
this.mMapView.invalidate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||
//UNUSED
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||
//UNUSED
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares a bundle containing all the information that needs to be saved, and returns it to the starting activity
|
||||
* @author ricky barrette
|
||||
*/
|
||||
private void save() {
|
||||
final ProgressDialog progress = ProgressDialog.show(this, "", this.getText(R.string.saving), true, true);
|
||||
|
||||
//Generate the intent in a thread to prevent anr's and allow for progress dialog
|
||||
new Thread( new Runnable(){
|
||||
@Override
|
||||
public void run(){
|
||||
Looper.prepare();
|
||||
|
||||
Intent data = new Intent(HowActivity.this, WhatActivity.class).putExtras(HowActivity.this.getIntent());
|
||||
GeoPoint point = HowActivity.this.mRadiusOverlay.getLocation();
|
||||
|
||||
ContentValues info = data.getParcelableExtra(ListActivity.KEY_INFO);
|
||||
|
||||
if(info == null)
|
||||
info = new ContentValues();
|
||||
/*
|
||||
* package the ringer table information
|
||||
*/
|
||||
info.put(RingerDatabase.KEY_LOCATION_LAT, point.getLatitudeE6());
|
||||
info.put(RingerDatabase.KEY_LOCATION_LON, point.getLongitudeE6());
|
||||
info.put(RingerDatabase.KEY_RADIUS, HowActivity.this.mRadius.getProgress());
|
||||
|
||||
//package the intent
|
||||
data.putExtra(ListActivity.KEY_INFO, info);
|
||||
progress.dismiss();
|
||||
HowActivity.this.startActivityForResult(data, WHAT_REQUEST_CODE);
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -39,7 +39,7 @@ import com.skyhookwireless.wps.RegistrationCallback;
|
||||
import com.skyhookwireless.wps.WPSContinuation;
|
||||
import com.skyhookwireless.wps.WPSReturnCode;
|
||||
|
||||
public class RingerListActivity extends Activity implements OnItemClickListener, OnClickListener, DatabaseListener, RegistrationCallback {
|
||||
public class ListActivity extends Activity implements OnItemClickListener, OnClickListener, DatabaseListener, RegistrationCallback {
|
||||
|
||||
private RingerDatabase mDb;
|
||||
private ListView mListView;
|
||||
@@ -48,6 +48,7 @@ public class RingerListActivity extends Activity implements OnItemClickListener,
|
||||
|
||||
public static final String KEY_RINGER = "key_ringer";
|
||||
public static final String KEY_INFO = "key_info";
|
||||
public static final String KEY_IS_DEFAULT = "key_is_default";
|
||||
private static final int NEW_RINGER = 0;
|
||||
private static final int DELETE_ID = 1;
|
||||
private static final int ACTIVITY_CREATE = 3;
|
||||
@@ -55,6 +56,7 @@ public class RingerListActivity extends Activity implements OnItemClickListener,
|
||||
private static final int SETTINGS = 7;
|
||||
private static final int BACKUP = 8;
|
||||
private static final int RESTORE = 9;
|
||||
private static final String KEY_ROWID = "key_row_id";
|
||||
|
||||
@Override
|
||||
public void done() {
|
||||
@@ -89,8 +91,7 @@ public class RingerListActivity extends Activity implements OnItemClickListener,
|
||||
populate();
|
||||
break;
|
||||
case ACTIVITY_EDIT:
|
||||
mDb.updateRinger(intent.getLongExtra(RingerInformationActivity.KEY_ROWID, 0),
|
||||
(ContentValues) intent.getParcelableExtra(KEY_RINGER), (ContentValues) intent.getParcelableExtra(KEY_INFO));
|
||||
mDb.updateRinger(intent.getLongExtra(KEY_ROWID, 1), (ContentValues) intent.getParcelableExtra(KEY_RINGER), (ContentValues) intent.getParcelableExtra(KEY_INFO));
|
||||
populate();
|
||||
break;
|
||||
}
|
||||
@@ -99,7 +100,7 @@ public class RingerListActivity extends Activity implements OnItemClickListener,
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent i = new Intent(this, RingerInformationActivity.class);
|
||||
Intent i = new Intent(this, HowActivity.class);
|
||||
startActivityForResult(i, ACTIVITY_CREATE );
|
||||
}
|
||||
|
||||
@@ -226,38 +227,28 @@ public class RingerListActivity extends Activity implements OnItemClickListener,
|
||||
public void run(){
|
||||
Looper.prepare();
|
||||
|
||||
Intent i = new Intent(RingerListActivity.this, RingerInformationActivity.class);
|
||||
Intent i = new Intent(ListActivity.this, HowActivity.class)
|
||||
.putExtra(KEY_ROWID, id+1);
|
||||
|
||||
/*
|
||||
* get the ringer
|
||||
*/
|
||||
Cursor ringer = mDb.getRingerFromId(id+1);
|
||||
if (ringer.moveToFirst()) {
|
||||
i.putExtra(RingerInformationActivity.KEY_ROWID, id+1)
|
||||
.putExtra(RingerDatabase.KEY_RINGER_NAME, ringer.getString(0))
|
||||
.putExtra(RingerDatabase.KEY_IS_ENABLED, ringer.getString(1)== null ? true :(Integer.parseInt(ringer.getString(1)) == 1 ? true : false))//5
|
||||
.putExtra(RingerDatabase.KEY_RADIUS, ringer.getInt(2))
|
||||
.putExtra(RingerDatabase.KEY_LOCATION_LAT, ringer.getInt(3))
|
||||
.putExtra(RingerDatabase.KEY_LOCATION_LON, ringer.getInt(4));
|
||||
}
|
||||
if (ringer.moveToFirst())
|
||||
i.putExtra(RingerDatabase.KEY_RINGER_NAME, ringer.getString(0))
|
||||
.putExtra(RingerDatabase.KEY_IS_ENABLED, RingerDatabase.parseBoolean(ringer.getString(1)));
|
||||
|
||||
if (ringer != null && !ringer.isClosed()) {
|
||||
ringer.close();
|
||||
}
|
||||
|
||||
if(id == 0)
|
||||
i.putExtra(KEY_IS_DEFAULT, true);
|
||||
|
||||
/*
|
||||
* get the ringer's info, and parse it into content values
|
||||
*/
|
||||
ContentValues values = new ContentValues();
|
||||
Cursor info = mDb.getRingerInfo(i.getStringExtra(RingerDatabase.KEY_RINGER_NAME));
|
||||
if (info.moveToFirst()) {
|
||||
do {
|
||||
values.put(info.getString(0), info.getString(1));
|
||||
} while (info.moveToNext());
|
||||
}
|
||||
if (info != null && !info.isClosed()) {
|
||||
info.close();
|
||||
}
|
||||
i.putExtra(KEY_INFO, values);
|
||||
i.putExtra(KEY_INFO, mDb.getRingerInfo(i.getStringExtra(RingerDatabase.KEY_RINGER_NAME)));
|
||||
|
||||
progress.dismiss();
|
||||
|
||||
@@ -278,7 +269,7 @@ public class RingerListActivity extends Activity implements OnItemClickListener,
|
||||
public boolean onOptionsItemSelected (MenuItem item) {
|
||||
switch (item.getItemId()){
|
||||
case NEW_RINGER:
|
||||
Intent i = new Intent(this, RingerInformationActivity.class);
|
||||
Intent i = new Intent(this, WhatActivity.class);
|
||||
startActivityForResult(i, ACTIVITY_CREATE );
|
||||
return true;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
package com.TwentyCodes.android.LocationRinger.ui;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.ContentValues;
|
||||
@@ -19,68 +20,45 @@ import android.media.RingtoneManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.CompoundButton.OnCheckedChangeListener;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.SeekBar.OnSeekBarChangeListener;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.Toast;
|
||||
import android.widget.ToggleButton;
|
||||
|
||||
import com.TwentyCodes.android.LocationRinger.LocationSelectedListener;
|
||||
import com.TwentyCodes.android.LocationRinger.R;
|
||||
import com.TwentyCodes.android.LocationRinger.db.RingerDatabase;
|
||||
import com.TwentyCodes.android.LocationRinger.debug.Debug;
|
||||
import com.TwentyCodes.android.SkyHook.SkyHook;
|
||||
import com.TwentyCodes.android.location.GeoPointLocationListener;
|
||||
import com.TwentyCodes.android.location.MapView;
|
||||
import com.google.android.maps.GeoPoint;
|
||||
|
||||
/**
|
||||
* This activity will be used to display all the ringers information, and handle modification to that information
|
||||
* This activity will be used to display what this ringer controls. here the user will be able to add or modify features they wish to control
|
||||
* @author ricky barrette
|
||||
*/
|
||||
public class RingerInformationActivity extends com.google.android.maps.MapActivity implements OnCheckedChangeListener, OnClickListener, OnSeekBarChangeListener, GeoPointLocationListener, LocationSelectedListener {
|
||||
public class WhatActivity extends Activity implements OnCheckedChangeListener, OnClickListener {
|
||||
|
||||
public static final String KEY_ROWID = "row_id";
|
||||
private static final int SAVE_ID = 0;
|
||||
private static final String TAG = "RingerInformationActivity";
|
||||
//private static final String TAG = "RingerInformationWhatActivity";
|
||||
private static final int ADD_ID = 1;
|
||||
private SeekBar mRingtonVolume;
|
||||
private SeekBar mRadius;
|
||||
private SeekBar mNotificationRingtoneVolume;
|
||||
private MapView mMapView;
|
||||
private EditText mNotificationRingtone;
|
||||
private EditText mRingerName;
|
||||
private EditText mRingtone;
|
||||
private ToggleButton mNotificationRingtoneToggle;
|
||||
private ToggleButton mRingerToggle;
|
||||
private ToggleButton mRingtoneToggle;
|
||||
private ScrollView mScrollView;
|
||||
private String mRingtoneURI;
|
||||
private String mNotificationRingtoneURI;
|
||||
private ToggleButton mMapEditToggle;
|
||||
private RadiusOverlay mRadiusOverlay;
|
||||
private long mRowID;
|
||||
private ToggleButton mWifiToggle;
|
||||
private ToggleButton mBTToggle;
|
||||
private GeoPoint mPoint;
|
||||
private SeekBar mAlarmVolume;
|
||||
private ProgressBar mMusicVolume;
|
||||
private SkyHook mSkyHook;
|
||||
private ProgressDialog mGpsProgress;
|
||||
private boolean isFirstFix;
|
||||
|
||||
private void addFeature(int item) {
|
||||
String feature = this.getResources().getStringArray(R.array.features)[item];
|
||||
@@ -122,6 +100,14 @@ public class RingerInformationActivity extends com.google.android.maps.MapActivi
|
||||
* @author ricky
|
||||
*/
|
||||
private void displayFeaturesDialog() {
|
||||
|
||||
/*
|
||||
* TODO
|
||||
* Check to see if wifi is available
|
||||
* check to see if bluetooth is available,
|
||||
* remove unavailable options
|
||||
*/
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(this.getText(R.string.add_feature));
|
||||
builder.setItems(R.array.features, new DialogInterface.OnClickListener() {
|
||||
@@ -155,12 +141,6 @@ public class RingerInformationActivity extends com.google.android.maps.MapActivi
|
||||
startActivityForResult( intent, ringtoneCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isRouteDisplayed() {
|
||||
//UNUSED
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the rintone picker activity returns it's result
|
||||
*/
|
||||
@@ -191,65 +171,28 @@ public class RingerInformationActivity extends com.google.android.maps.MapActivi
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
switch(buttonView.getId()){
|
||||
case R.id.ringer_toggle:
|
||||
this.mRadius.setEnabled(isChecked);
|
||||
this.mRingtone.setEnabled(isChecked);
|
||||
this.mRingtonVolume.setEnabled(isChecked);
|
||||
this.mNotificationRingtone.setEnabled(isChecked);
|
||||
this.mNotificationRingtoneVolume.setEnabled(isChecked);
|
||||
this.mNotificationRingtoneToggle.setEnabled(isChecked);
|
||||
this.mMapView.setEnabled(isChecked);
|
||||
this.mNotificationRingtoneToggle.setEnabled(isChecked);
|
||||
this.mRingtoneToggle.setEnabled(isChecked);
|
||||
this.mMapEditToggle.setEnabled(isChecked);
|
||||
//TODO disable all the child views, or find xml tag to allow setting of child view enabled via parent
|
||||
findViewById(R.id.ringtone_info).setEnabled(isChecked);
|
||||
findViewById(R.id.notification_ringtone_info).setEnabled(isChecked);
|
||||
findViewById(R.id.alarm_volume_info).setEnabled(isChecked);
|
||||
findViewById(R.id.music_volume_info).setEnabled(isChecked);
|
||||
findViewById(R.id.bluetooth_toggle).setEnabled(isChecked);
|
||||
findViewById(R.id.wifi_toggle).setEnabled(isChecked);
|
||||
findViewById(R.id.update_interval_info).setEnabled(isChecked);
|
||||
findViewById(R.id.data_label).setEnabled(isChecked);
|
||||
break;
|
||||
|
||||
case R.id.notification_silent_toggle:
|
||||
findViewById(R.id.notification_ringtone_button).setEnabled(!isChecked);
|
||||
this.mNotificationRingtone.setEnabled(!isChecked);
|
||||
this.mNotificationRingtoneVolume.setEnabled(!isChecked);
|
||||
break;
|
||||
|
||||
case R.id.ringtone_silent_toggle:
|
||||
this.mRingtone.setEnabled(!isChecked);
|
||||
findViewById(R.id.ringtone_button).setEnabled(!isChecked);
|
||||
this.mRingtonVolume.setEnabled(!isChecked);
|
||||
break;
|
||||
|
||||
case R.id.map_edit_toggle:
|
||||
this.isFirstFix = isChecked;
|
||||
|
||||
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,
|
||||
isChecked
|
||||
? (this.getResources().getDisplayMetrics().heightPixels - findViewById(R.id.map_controls).getHeight())
|
||||
: (int) (TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 350, getResources().getDisplayMetrics())));
|
||||
if(isChecked){
|
||||
this.mSkyHook.getUpdates();
|
||||
params.addRule(RelativeLayout.ALIGN_PARENT_TOP );
|
||||
this.mGpsProgress = ProgressDialog.show(this, "", this.getText(R.string.gps_fix), true, true);
|
||||
} else {
|
||||
this.mSkyHook.removeUpdates();
|
||||
params.addRule(RelativeLayout.BELOW, R.id.info);
|
||||
params.addRule(RelativeLayout.ALIGN_BOTTOM );
|
||||
if(this.mGpsProgress != null)
|
||||
this.mGpsProgress.dismiss();
|
||||
}
|
||||
findViewById(R.id.map_info).setLayoutParams(params );
|
||||
|
||||
this.mMapView.setDoubleTapZoonEnabled(isChecked);
|
||||
//views
|
||||
findViewById(R.id.info).setVisibility(isChecked ? View.GONE : View.VISIBLE);
|
||||
findViewById(R.id.ringer_options).setVisibility(isChecked ? View.GONE : View.VISIBLE);
|
||||
//buttons
|
||||
findViewById(R.id.mark_my_location).setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||
findViewById(R.id.my_location).setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||
findViewById(R.id.map_mode).setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||
findViewById(R.id.search).setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||
findViewById(R.id.add_feature_button).setVisibility(isChecked ? View.GONE : View.VISIBLE);
|
||||
this.mScrollView.invalidate();
|
||||
this.mScrollView.setScrollEnabled(! isChecked);
|
||||
this.mMapView.setBuiltInZoomControls(isChecked);
|
||||
this.mMapView.setClickable(isChecked);
|
||||
this.mRadius.setEnabled(isChecked);
|
||||
Toast.makeText(this, isChecked ? getString(R.string.map_editing_enabled) : getString(R.string.map_editiing_disabled), Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,22 +212,6 @@ public class RingerInformationActivity extends com.google.android.maps.MapActivi
|
||||
case R.id.save_ringer_button:
|
||||
save();
|
||||
break;
|
||||
case R.id.mark_my_location:
|
||||
if(this.mPoint != null){
|
||||
this.mRadiusOverlay.setLocation(mPoint);
|
||||
this.mMapView.getController().setCenter(mPoint);
|
||||
}
|
||||
break;
|
||||
case R.id.my_location:
|
||||
if(this.mPoint != null)
|
||||
this.mMapView.getController().setCenter(mPoint);
|
||||
break;
|
||||
case R.id.map_mode:
|
||||
this.mMapView.setSatellite(mMapView.isSatellite() ? false : true);
|
||||
break;
|
||||
case R.id.search:
|
||||
new SearchDialog(this, this).show();
|
||||
break;
|
||||
case R.id.add_feature_button:
|
||||
findViewById(R.id.add_a_feature_label).setVisibility(View.GONE);
|
||||
displayFeaturesDialog();
|
||||
@@ -300,42 +227,18 @@ public class RingerInformationActivity extends com.google.android.maps.MapActivi
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
/*
|
||||
* TODO
|
||||
* Check to see if wifi is available
|
||||
* check to see if bluetooth is available,
|
||||
* remove unavailable options
|
||||
*/
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
this.setContentView(R.layout.ringer_info);
|
||||
this.setContentView(R.layout.what);
|
||||
|
||||
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
|
||||
|
||||
AudioManager mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
|
||||
|
||||
this.mSkyHook = new SkyHook(this);
|
||||
this.mSkyHook.setLocationListener(this);
|
||||
|
||||
this.mScrollView = (ScrollView) findViewById(R.id.scrollview);
|
||||
|
||||
this.mRingerName = (EditText) findViewById(R.id.ringer_name);
|
||||
this.mRingerToggle = (ToggleButton) findViewById(R.id.ringer_toggle);
|
||||
this.mRingerToggle.setChecked(true);
|
||||
this.mRingerToggle.setOnCheckedChangeListener(this);
|
||||
|
||||
this.mMapView = (MapView) findViewById(R.id.mapview);
|
||||
this.mRadius = (SeekBar) findViewById(R.id.radius);
|
||||
this.mRadius.setMax(Debug.MAX_RADIUS_IN_METERS);
|
||||
this.mMapView.setClickable(false);
|
||||
this.mMapEditToggle = (ToggleButton) findViewById(R.id.map_edit_toggle);
|
||||
this.mMapEditToggle.setChecked(false);
|
||||
this.mMapEditToggle.setOnCheckedChangeListener(this);
|
||||
this.mRadiusOverlay = new RadiusOverlay();
|
||||
this.mRadius.setOnSeekBarChangeListener(this);
|
||||
this.mMapView.getOverlays().add(mRadiusOverlay);
|
||||
this.mRadius.setEnabled(false);
|
||||
|
||||
this.mRingtone = (EditText) findViewById(R.id.ringtone);
|
||||
this.mRingtoneToggle = (ToggleButton) findViewById(R.id.ringtone_silent_toggle);
|
||||
this.mRingtonVolume = (SeekBar) findViewById(R.id.ringtone_volume);
|
||||
@@ -396,20 +299,32 @@ public class RingerInformationActivity extends com.google.android.maps.MapActivi
|
||||
|
||||
Intent data = this.getIntent();
|
||||
|
||||
if(data.hasExtra(KEY_ROWID)){
|
||||
if(data.hasExtra(ListActivity.KEY_INFO)){
|
||||
|
||||
this.mRowID = data.getLongExtra(KEY_ROWID, 0);
|
||||
this.mRingerToggle.setChecked(data.getBooleanExtra(RingerDatabase.KEY_IS_ENABLED, true));
|
||||
this.mRadiusOverlay.setLocation(new GeoPoint(data.getIntExtra(RingerDatabase.KEY_LOCATION_LAT, 0), data.getIntExtra(RingerDatabase.KEY_LOCATION_LON, 0)));
|
||||
this.mRadius.setProgress(data.getIntExtra(RingerDatabase.KEY_RADIUS, 0));
|
||||
this.mRingerName.setText(data.getStringExtra(RingerDatabase.KEY_RINGER_NAME));
|
||||
this.setTitle(getString(R.string.editing)+" "+mRingerName.getText().toString());
|
||||
|
||||
/*
|
||||
* if this is the default ringer, then we will display everything
|
||||
*/
|
||||
if(data.getBooleanExtra(ListActivity.KEY_IS_DEFAULT, false)){
|
||||
findViewById(R.id.ringer_options).setVisibility(View.GONE);
|
||||
findViewById(R.id.notification_ringtone_info).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.ringtone_info).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.wifi_toggle).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.data_label).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.bluetooth_toggle).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.music_volume_info).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.alarm_volume_info).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.update_interval_info).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.add_feature_button).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
/*
|
||||
* We need to null check all the values
|
||||
*/
|
||||
ContentValues info = (ContentValues) data.getParcelableExtra(RingerListActivity.KEY_INFO);
|
||||
ContentValues info = (ContentValues) data.getParcelableExtra(ListActivity.KEY_INFO);
|
||||
|
||||
if(RingerDatabase.parseBoolean(info.getAsString(RingerDatabase.KEY_PLUS_BUTTON_HINT)));
|
||||
findViewById(R.id.add_a_feature_label).setVisibility(View.GONE);
|
||||
@@ -482,29 +397,6 @@ public class RingerInformationActivity extends com.google.android.maps.MapActivi
|
||||
} else
|
||||
this.setTitle(R.string.new_ringer);
|
||||
|
||||
if(this.mRadiusOverlay.getLocation() != null){
|
||||
this.mMapView.getController().setCenter(this.mRadiusOverlay.getLocation());
|
||||
this.mMapView.getController().setZoom(16);
|
||||
}
|
||||
|
||||
if(this.mRingerName.getText().toString().equals(getString(R.string.default_ringer))){
|
||||
this.mMapView.setEnabled(false);
|
||||
this.mMapEditToggle.setEnabled(false);
|
||||
this.mRingerName.setEnabled(false);
|
||||
this.mRingerToggle.setEnabled(false);
|
||||
findViewById(R.id.ringer_options).setVisibility(View.GONE);
|
||||
findViewById(R.id.map_info).setVisibility(View.GONE);
|
||||
findViewById(R.id.notification_ringtone_info).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.ringtone_info).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.wifi_toggle).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.data_label).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.bluetooth_toggle).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.music_volume_info).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.alarm_volume_info).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.update_interval_info).setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
this.mMapView.setDoubleTapZoonEnabled(false);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -518,66 +410,6 @@ public class RingerInformationActivity extends com.google.android.maps.MapActivi
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.google.android.maps.MapActivity#onDestroy()
|
||||
* @author ricky barrette
|
||||
*/
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
this.mSkyHook.removeUpdates();
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when skyhook has a location to report
|
||||
* @author ricky barrette
|
||||
*/
|
||||
@Override
|
||||
public void onLocationChanged(GeoPoint point, int accuracy) {
|
||||
this.mPoint = point;
|
||||
|
||||
if(point != null){
|
||||
|
||||
/*
|
||||
* if this is the first fix and the radius overlay does not have a point specified
|
||||
* then pan the map, and zoom in to the users current location
|
||||
*/
|
||||
if(this.isFirstFix)
|
||||
if(this.mRadiusOverlay.getLocation() == null){
|
||||
if(this.mMapView != null){
|
||||
this.mMapView.getController().setCenter(point);
|
||||
this.mMapView.getController().setZoom((this.mMapView.getMaxZoomLevel() - 5));
|
||||
}
|
||||
this.isFirstFix = false;
|
||||
}
|
||||
|
||||
/*
|
||||
* dismiss the acquiring gps dialog
|
||||
*/
|
||||
if(this.mGpsProgress != null)
|
||||
this.mGpsProgress.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
@Override
|
||||
public void onLocationSelected(GeoPoint point) {
|
||||
if(point != null){
|
||||
if(Debug.DEBUG)
|
||||
Log.d(TAG, "onLocationSelected() "+ point.toString());
|
||||
|
||||
if(this.mRadiusOverlay != null)
|
||||
this.mRadiusOverlay.setLocation(point);
|
||||
|
||||
if(this.mMapView != null){
|
||||
this.mMapView.getController().setCenter(point);
|
||||
this.mMapView.getController().setZoom((this.mMapView.getMaxZoomLevel() - 5));
|
||||
}
|
||||
} else if(Debug.DEBUG)
|
||||
Log.d(TAG, "onLocationSelected() Location was null");
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see android.app.Activity#onOptionsItemSelected(android.view.MenuItem)
|
||||
* @author ricky barrette
|
||||
@@ -595,30 +427,6 @@ public class RingerInformationActivity extends com.google.android.maps.MapActivi
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a seekbar is has its progress changed
|
||||
* @author ricky barrette
|
||||
*/
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||
switch (seekBar.getId()){
|
||||
case R.id.radius:
|
||||
this.mRadiusOverlay.setRadius(progress);
|
||||
this.mMapView.invalidate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||
//UNUSED
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||
//UNUSED
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares a bundle containing all the information that needs to be saved, and returns it to the starting activity
|
||||
* @author ricky barrette
|
||||
@@ -632,68 +440,64 @@ public class RingerInformationActivity extends com.google.android.maps.MapActivi
|
||||
public void run(){
|
||||
Looper.prepare();
|
||||
|
||||
Intent data = new Intent();
|
||||
GeoPoint point = RingerInformationActivity.this.mRadiusOverlay.getLocation();
|
||||
Intent data = new Intent().putExtras(WhatActivity.this.getIntent());
|
||||
|
||||
//to prevent null pointers
|
||||
if(point == null)
|
||||
point = new GeoPoint(0,0);
|
||||
ContentValues ringer = WhatActivity.this.getIntent().getParcelableExtra(ListActivity.KEY_RINGER);
|
||||
ContentValues info = WhatActivity.this.getIntent().getParcelableExtra(ListActivity.KEY_INFO);
|
||||
|
||||
if(RingerInformationActivity.this.mRowID > 0)
|
||||
data.putExtra(KEY_ROWID, mRowID);
|
||||
if(ringer == null)
|
||||
ringer = new ContentValues();
|
||||
|
||||
ContentValues ringer = new ContentValues();
|
||||
ContentValues info = new ContentValues();
|
||||
if(info == null)
|
||||
info = new ContentValues();
|
||||
|
||||
/*
|
||||
* package the ringer table information
|
||||
*/
|
||||
ringer.put(RingerDatabase.KEY_RINGER_NAME, RingerInformationActivity.this.mRingerName.getText().toString());
|
||||
ringer.put(RingerDatabase.KEY_IS_ENABLED, RingerInformationActivity.this.mRingerToggle.isChecked());
|
||||
ringer.put(RingerDatabase.KEY_LOCATION_LAT, point.getLatitudeE6());
|
||||
ringer.put(RingerDatabase.KEY_LOCATION_LON, point.getLongitudeE6());
|
||||
ringer.put(RingerDatabase.KEY_RADIUS, RingerInformationActivity.this.mRadius.getProgress());
|
||||
ringer.put(RingerDatabase.KEY_RINGER_NAME, WhatActivity.this.mRingerName.getText().toString());
|
||||
ringer.put(RingerDatabase.KEY_IS_ENABLED, WhatActivity.this.mRingerToggle.isChecked());
|
||||
|
||||
/*
|
||||
* package the ringer_info table information
|
||||
*/
|
||||
if(findViewById(R.id.notification_ringtone_info).isShown()){
|
||||
info.put(RingerDatabase.KEY_NOTIFICATION_IS_SILENT, RingerInformationActivity.this.mNotificationRingtoneToggle.isChecked());
|
||||
info.put(RingerDatabase.KEY_NOTIFICATION_RINGTONE, RingerInformationActivity.this.mNotificationRingtone.getText().toString());
|
||||
info.put(RingerDatabase.KEY_NOTIFICATION_RINGTONE_URI, RingerInformationActivity.this.mNotificationRingtoneURI);
|
||||
info.put(RingerDatabase.KEY_NOTIFICATION_RINGTONE_VOLUME, RingerInformationActivity.this.mNotificationRingtoneVolume.getProgress());
|
||||
info.put(RingerDatabase.KEY_NOTIFICATION_IS_SILENT, WhatActivity.this.mNotificationRingtoneToggle.isChecked());
|
||||
info.put(RingerDatabase.KEY_NOTIFICATION_RINGTONE, WhatActivity.this.mNotificationRingtone.getText().toString());
|
||||
info.put(RingerDatabase.KEY_NOTIFICATION_RINGTONE_URI, WhatActivity.this.mNotificationRingtoneURI);
|
||||
info.put(RingerDatabase.KEY_NOTIFICATION_RINGTONE_VOLUME, WhatActivity.this.mNotificationRingtoneVolume.getProgress());
|
||||
}
|
||||
|
||||
if(findViewById(R.id.ringtone_info).isShown()){
|
||||
info.put(RingerDatabase.KEY_RINGTONE, RingerInformationActivity.this.mRingtone.getText().toString());
|
||||
info.put(RingerDatabase.KEY_RINGTONE_IS_SILENT, RingerInformationActivity.this.mRingtoneToggle.isChecked());
|
||||
info.put(RingerDatabase.KEY_RINGTONE_URI, RingerInformationActivity.this.mRingtoneURI);
|
||||
info.put(RingerDatabase.KEY_RINGTONE_VOLUME, RingerInformationActivity.this.mRingtonVolume.getProgress());
|
||||
info.put(RingerDatabase.KEY_RINGTONE, WhatActivity.this.mRingtone.getText().toString());
|
||||
info.put(RingerDatabase.KEY_RINGTONE_IS_SILENT, WhatActivity.this.mRingtoneToggle.isChecked());
|
||||
info.put(RingerDatabase.KEY_RINGTONE_URI, WhatActivity.this.mRingtoneURI);
|
||||
info.put(RingerDatabase.KEY_RINGTONE_VOLUME, WhatActivity.this.mRingtonVolume.getProgress());
|
||||
}
|
||||
|
||||
if(findViewById(R.id.wifi_toggle).isShown())
|
||||
info.put(RingerDatabase.KEY_WIFI, RingerInformationActivity.this.mWifiToggle.isChecked());
|
||||
info.put(RingerDatabase.KEY_WIFI, WhatActivity.this.mWifiToggle.isChecked());
|
||||
|
||||
if(findViewById(R.id.bluetooth_toggle).isShown())
|
||||
info.put(RingerDatabase.KEY_BT, RingerInformationActivity.this.mBTToggle.isChecked());
|
||||
info.put(RingerDatabase.KEY_BT, WhatActivity.this.mBTToggle.isChecked());
|
||||
|
||||
if(findViewById(R.id.music_volume_info).isShown())
|
||||
info.put(RingerDatabase.KEY_MUSIC_VOLUME, RingerInformationActivity.this.mMusicVolume.getProgress());
|
||||
info.put(RingerDatabase.KEY_MUSIC_VOLUME, WhatActivity.this.mMusicVolume.getProgress());
|
||||
|
||||
if(findViewById(R.id.alarm_volume_info).isShown())
|
||||
info.put(RingerDatabase.KEY_ALARM_VOLUME, RingerInformationActivity.this.mAlarmVolume.getProgress());
|
||||
info.put(RingerDatabase.KEY_ALARM_VOLUME, WhatActivity.this.mAlarmVolume.getProgress());
|
||||
|
||||
if(findViewById(R.id.update_interval_info).isShown())
|
||||
info.put(RingerDatabase.KEY_UPDATE_INTERVAL,
|
||||
RingerInformationActivity.this.getResources().getStringArray(R.array.runtimes)[((Spinner) findViewById(R.id.update_interval)).getSelectedItemPosition()]);
|
||||
WhatActivity.this.getResources().getStringArray(R.array.runtimes)[((Spinner) findViewById(R.id.update_interval)).getSelectedItemPosition()]);
|
||||
|
||||
info.put(RingerDatabase.KEY_PLUS_BUTTON_HINT, true);
|
||||
|
||||
//package the intent
|
||||
data.putExtra(RingerListActivity.KEY_RINGER, ringer).putExtra(RingerListActivity.KEY_INFO, info);
|
||||
RingerInformationActivity.this.setResult(RESULT_OK, data);
|
||||
data.putExtra(ListActivity.KEY_RINGER, ringer).putExtra(ListActivity.KEY_INFO, info);
|
||||
|
||||
WhatActivity.this.setResult(RESULT_OK, data);
|
||||
progress.dismiss();
|
||||
RingerInformationActivity.this.finish();
|
||||
WhatActivity.this.finish();
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
Reference in New Issue
Block a user