From eeb0fd04dc3a2c1f329630abfba7033626c755c5 Mon Sep 17 00:00:00 2001 From: Ronald Li Date: Thu, 17 Jul 2014 17:57:30 +0800 Subject: [PATCH 1/3] disabled get cached drawing from root view in ScreenUtils.java --- shaketobug-library/src/com/shaketobug/ScreenUtils.java | 1 + 1 file changed, 1 insertion(+) diff --git a/shaketobug-library/src/com/shaketobug/ScreenUtils.java b/shaketobug-library/src/com/shaketobug/ScreenUtils.java index 8c3cfc7..fdaaf56 100644 --- a/shaketobug-library/src/com/shaketobug/ScreenUtils.java +++ b/shaketobug-library/src/com/shaketobug/ScreenUtils.java @@ -40,6 +40,7 @@ public class ScreenUtils { * @return {@link Bitmap} */ public static Bitmap takeScreenshot(View rootView) { + rootView.destroyDrawingCache(); rootView.setDrawingCacheEnabled(true); Bitmap screenBitmap = rootView.getDrawingCache(); return screenBitmap; From 7f1e4238b7932ee7a53795d606ad6d4a329edd40 Mon Sep 17 00:00:00 2001 From: Ronald Li Date: Thu, 17 Jul 2014 17:58:56 +0800 Subject: [PATCH 2/3] Added file extension for screenshot file so that it can be preview in email in ScreenUtils --- shaketobug-library/src/com/shaketobug/ScreenUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shaketobug-library/src/com/shaketobug/ScreenUtils.java b/shaketobug-library/src/com/shaketobug/ScreenUtils.java index fdaaf56..97f5dea 100644 --- a/shaketobug-library/src/com/shaketobug/ScreenUtils.java +++ b/shaketobug-library/src/com/shaketobug/ScreenUtils.java @@ -75,7 +75,7 @@ public static String createNameforFile() { */ public static String saveScreenshot(Bitmap bitmap) { String externalPath = Environment.getExternalStorageDirectory() + "/"; - String filePath = externalPath + createNameforFile(); + String filePath = externalPath + createNameforFile() + ".jpeg"; File imageFile = new File(filePath); FileOutputStream fos; From 226f1a6f01c232fcf4211b02c54a7c4a46bcaf4b Mon Sep 17 00:00:00 2001 From: Ronald Li Date: Thu, 17 Jul 2014 18:01:29 +0800 Subject: [PATCH 3/3] Fixed .gitignore file to exclude all gen files --- .gitignore | 6 +- .../com/shake2bug/android/BuildConfig.java | 6 - .../gen/com/shake2bug/android/R.java | 127 ------------ .../gen/com/shake2bug/android/R.java | 53 ----- .../shaketobugsample/android/BuildConfig.java | 6 - .../gen/com/shaketobugsample/android/R.java | 186 ------------------ 6 files changed, 3 insertions(+), 381 deletions(-) delete mode 100644 shaketobug-library/gen/com/shake2bug/android/BuildConfig.java delete mode 100644 shaketobug-library/gen/com/shake2bug/android/R.java delete mode 100644 shaketobug-sample/gen/com/shake2bug/android/R.java delete mode 100644 shaketobug-sample/gen/com/shaketobugsample/android/BuildConfig.java delete mode 100644 shaketobug-sample/gen/com/shaketobugsample/android/R.java diff --git a/.gitignore b/.gitignore index 3723718..9622edc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ /assets/* -/bin/* -/gen/* -/libs/* +bin +gen +libs /res/* diff --git a/shaketobug-library/gen/com/shake2bug/android/BuildConfig.java b/shaketobug-library/gen/com/shake2bug/android/BuildConfig.java deleted file mode 100644 index 3823a42..0000000 --- a/shaketobug-library/gen/com/shake2bug/android/BuildConfig.java +++ /dev/null @@ -1,6 +0,0 @@ -/** Automatically generated file. DO NOT MODIFY */ -package com.shake2bug.android; - -public final class BuildConfig { - public final static boolean DEBUG = true; -} \ No newline at end of file diff --git a/shaketobug-library/gen/com/shake2bug/android/R.java b/shaketobug-library/gen/com/shake2bug/android/R.java deleted file mode 100644 index 92f5d0d..0000000 --- a/shaketobug-library/gen/com/shake2bug/android/R.java +++ /dev/null @@ -1,127 +0,0 @@ -/* AUTO-GENERATED FILE. DO NOT MODIFY. - * - * This class was automatically generated by the - * aapt tool from the resource data it found. It - * should not be modified by hand. - */ - -package com.shake2bug.android; - -public final class R { - public static final class attr { - /**

Must be a reference to another resource, in the form "@[+][package:]type:name" -or to a theme attribute in the form "?[package:][type:]name". - */ - public static int buttonBarButtonStyle=0x7f010001; - /**

Must be a reference to another resource, in the form "@[+][package:]type:name" -or to a theme attribute in the form "?[package:][type:]name". - */ - public static int buttonBarStyle=0x7f010000; - } - public static final class color { - public static int black_overlay=0x7f040000; - } - public static final class dimen { - /** Default screen margins, per the Android Design guidelines. - - Customize dimensions originally defined in res/values/dimens.xml (such as - screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. - - */ - public static int activity_horizontal_margin=0x7f050000; - public static int activity_vertical_margin=0x7f050001; - } - public static final class drawable { - public static int ic_action_send_dark=0x7f020000; - public static int ic_action_send_light=0x7f020001; - public static int ic_launcher=0x7f020002; - } - public static final class id { - public static int flashPanel=0x7f080001; - public static int screenImageView=0x7f080000; - } - public static final class layout { - public static int activity_feedback=0x7f030000; - } - public static final class string { - public static int actionbar_send_string=0x7f060004; - public static int app_name=0x7f060000; - public static int mail_intent_title=0x7f060002; - public static int screenshotContentDescription=0x7f060003; - public static int title_activity_feedback=0x7f060001; - } - public static final class style { - /** - Base application theme, dependent on API level. This theme is replaced - by AppBaseTheme from res/values-vXX/styles.xml on newer devices. - - - Theme customizations available in newer API levels can go in - res/values-vXX/styles.xml, while customizations related to - backward-compatibility can go here. - - - Base application theme for API 11+. This theme completely replaces - AppBaseTheme from res/values/styles.xml on API 11+ devices. - - API 11 theme customizations can go here. - - Base application theme for API 14+. This theme completely replaces - AppBaseTheme from BOTH res/values/styles.xml and - res/values-v11/styles.xml on API 14+ devices. - - API 14 theme customizations can go here. - */ - public static int AppBaseTheme=0x7f070000; - /** Application theme. - All customizations that are NOT specific to a particular API-level can go here. - */ - public static int AppTheme=0x7f070001; - public static int ButtonBar=0x7f070003; - public static int ButtonBarButton=0x7f070004; - public static int FullscreenActionBarStyle=0x7f070005; - public static int FullscreenTheme=0x7f070002; - } - public static final class styleable { - /** - Declare custom theme attributes that allow changing which styles are - used for button bars depending on the API level. - ?android:attr/buttonBarStyle is new as of API 11 so this is - necessary to support previous API levels. - -

Includes the following attributes:

- - - - - - -
AttributeDescription
{@link #ButtonBarContainerTheme_buttonBarButtonStyle com.shake2bug.android:buttonBarButtonStyle}
{@link #ButtonBarContainerTheme_buttonBarStyle com.shake2bug.android:buttonBarStyle}
- @see #ButtonBarContainerTheme_buttonBarButtonStyle - @see #ButtonBarContainerTheme_buttonBarStyle - */ - public static final int[] ButtonBarContainerTheme = { - 0x7f010000, 0x7f010001 - }; - /** -

This symbol is the offset where the {@link com.shake2bug.android.R.attr#buttonBarButtonStyle} - attribute's value can be found in the {@link #ButtonBarContainerTheme} array. - - -

Must be a reference to another resource, in the form "@[+][package:]type:name" -or to a theme attribute in the form "?[package:][type:]name". - @attr name com.shake2bug.android:buttonBarButtonStyle - */ - public static final int ButtonBarContainerTheme_buttonBarButtonStyle = 1; - /** -

This symbol is the offset where the {@link com.shake2bug.android.R.attr#buttonBarStyle} - attribute's value can be found in the {@link #ButtonBarContainerTheme} array. - - -

Must be a reference to another resource, in the form "@[+][package:]type:name" -or to a theme attribute in the form "?[package:][type:]name". - @attr name com.shake2bug.android:buttonBarStyle - */ - public static final int ButtonBarContainerTheme_buttonBarStyle = 0; - }; -} diff --git a/shaketobug-sample/gen/com/shake2bug/android/R.java b/shaketobug-sample/gen/com/shake2bug/android/R.java deleted file mode 100644 index 7e8a589..0000000 --- a/shaketobug-sample/gen/com/shake2bug/android/R.java +++ /dev/null @@ -1,53 +0,0 @@ -/* AUTO-GENERATED FILE. DO NOT MODIFY. - * - * This class was automatically generated by the - * aapt tool from the resource data it found. It - * should not be modified by hand. - */ -package com.shake2bug.android; - -public final class R { - public static final class attr { - public static final int buttonBarButtonStyle = 0x7f010001; - public static final int buttonBarStyle = 0x7f010000; - } - public static final class color { - public static final int black_overlay = 0x7f040000; - } - public static final class dimen { - public static final int activity_horizontal_margin = 0x7f050000; - public static final int activity_vertical_margin = 0x7f050001; - } - public static final class drawable { - public static final int ic_action_send_dark = 0x7f020000; - public static final int ic_action_send_light = 0x7f020001; - public static final int ic_launcher = 0x7f020002; - } - public static final class id { - public static final int flashPanel = 0x7f090001; - public static final int screenImageView = 0x7f090000; - } - public static final class layout { - public static final int activity_feedback = 0x7f030000; - } - public static final class string { - public static final int actionbar_send_string = 0x7f060004; - public static final int app_name = 0x7f060000; - public static final int mail_intent_title = 0x7f060002; - public static final int screenshotContentDescription = 0x7f060003; - public static final int title_activity_feedback = 0x7f060001; - } - public static final class style { - public static final int AppBaseTheme = 0x7f070000; - public static final int AppTheme = 0x7f070001; - public static final int ButtonBar = 0x7f070003; - public static final int ButtonBarButton = 0x7f070004; - public static final int FullscreenActionBarStyle = 0x7f070005; - public static final int FullscreenTheme = 0x7f070002; - } - public static final class styleable { - public static final int[] ButtonBarContainerTheme = { 0x7f010000, 0x7f010001 }; - public static final int ButtonBarContainerTheme_buttonBarButtonStyle = 1; - public static final int ButtonBarContainerTheme_buttonBarStyle = 0; - } -} diff --git a/shaketobug-sample/gen/com/shaketobugsample/android/BuildConfig.java b/shaketobug-sample/gen/com/shaketobugsample/android/BuildConfig.java deleted file mode 100644 index 39e058b..0000000 --- a/shaketobug-sample/gen/com/shaketobugsample/android/BuildConfig.java +++ /dev/null @@ -1,6 +0,0 @@ -/** Automatically generated file. DO NOT MODIFY */ -package com.shaketobugsample.android; - -public final class BuildConfig { - public final static boolean DEBUG = true; -} \ No newline at end of file diff --git a/shaketobug-sample/gen/com/shaketobugsample/android/R.java b/shaketobug-sample/gen/com/shaketobugsample/android/R.java deleted file mode 100644 index e7da4a2..0000000 --- a/shaketobug-sample/gen/com/shaketobugsample/android/R.java +++ /dev/null @@ -1,186 +0,0 @@ -/* AUTO-GENERATED FILE. DO NOT MODIFY. - * - * This class was automatically generated by the - * aapt tool from the resource data it found. It - * should not be modified by hand. - */ - -package com.shaketobugsample.android; - -public final class R { - public static final class attr { - /**

Must be a reference to another resource, in the form "@[+][package:]type:name" -or to a theme attribute in the form "?[package:][type:]name". - */ - public static final int buttonBarButtonStyle=0x7f010001; - /**

Must be a reference to another resource, in the form "@[+][package:]type:name" -or to a theme attribute in the form "?[package:][type:]name". - */ - public static final int buttonBarStyle=0x7f010000; - } - public static final class color { - public static final int black_overlay=0x7f040000; - } - public static final class dimen { - /** Default screen margins, per the Android Design guidelines. - - Customize dimensions originally defined in res/values/dimens.xml (such as - screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. - - Default screen margins, per the Android Design guidelines. - - Customize dimensions originally defined in res/values/dimens.xml (such as - screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. - - */ - public static final int activity_horizontal_margin=0x7f050000; - public static final int activity_vertical_margin=0x7f050001; - } - public static final class drawable { - public static final int ic_action_send_dark=0x7f020000; - public static final int ic_action_send_light=0x7f020001; - public static final int ic_launcher=0x7f020002; - public static final int yellow_header_background=0x7f020003; - } - public static final class id { - public static final int action_forgot_password=0x7f090009; - public static final int action_settings=0x7f09000a; - public static final int email=0x7f090005; - public static final int flashPanel=0x7f090001; - public static final int login=0x7f090007; - public static final int login_form=0x7f090004; - public static final int login_status=0x7f090002; - public static final int login_status_message=0x7f090003; - public static final int password=0x7f090006; - public static final int screenImageView=0x7f090000; - public static final int sign_in_button=0x7f090008; - } - public static final class layout { - public static final int activity_feedback=0x7f030000; - public static final int activity_login=0x7f030001; - public static final int activity_main=0x7f030002; - } - public static final class menu { - public static final int login=0x7f080000; - public static final int main=0x7f080001; - } - public static final class string { - public static final int action_forgot_password=0x7f06000c; - public static final int action_settings=0x7f060005; - public static final int action_sign_in_register=0x7f06000a; - public static final int action_sign_in_short=0x7f06000b; - public static final int actionbar_send_string=0x7f060004; - public static final int app_name=0x7f060000; - public static final int error_field_required=0x7f060011; - public static final int error_incorrect_password=0x7f060010; - public static final int error_invalid_email=0x7f06000e; - public static final int error_invalid_password=0x7f06000f; - public static final int hello_world=0x7f060006; - public static final int login_progress_signing_in=0x7f06000d; - public static final int mail_intent_title=0x7f060002; - /** Strings related to login - */ - public static final int prompt_email=0x7f060008; - public static final int prompt_password=0x7f060009; - public static final int screenshotContentDescription=0x7f060003; - public static final int title_activity_feedback=0x7f060001; - public static final int title_activity_login=0x7f060007; - } - public static final class style { - /** - Base application theme, dependent on API level. This theme is replaced - by AppBaseTheme from res/values-vXX/styles.xml on newer devices. - - - Theme customizations available in newer API levels can go in - res/values-vXX/styles.xml, while customizations related to - backward-compatibility can go here. - - - Base application theme for API 11+. This theme completely replaces - AppBaseTheme from res/values/styles.xml on API 11+ devices. - - API 11 theme customizations can go here. - - Base application theme for API 14+. This theme completely replaces - AppBaseTheme from BOTH res/values/styles.xml and - res/values-v11/styles.xml on API 14+ devices. - - API 14 theme customizations can go here. - - Base application theme, dependent on API level. This theme is replaced - by AppBaseTheme from res/values-vXX/styles.xml on newer devices. - - - Theme customizations available in newer API levels can go in - res/values-vXX/styles.xml, while customizations related to - backward-compatibility can go here. - - - Base application theme for API 11+. This theme completely replaces - AppBaseTheme from res/values/styles.xml on API 11+ devices. - - API 11 theme customizations can go here. - - Base application theme for API 14+. This theme completely replaces - AppBaseTheme from BOTH res/values/styles.xml and - res/values-v11/styles.xml on API 14+ devices. - - API 14 theme customizations can go here. - */ - public static final int AppBaseTheme=0x7f070000; - /** Application theme. - All customizations that are NOT specific to a particular API-level can go here. - Application theme. - All customizations that are NOT specific to a particular API-level can go here. - */ - public static final int AppTheme=0x7f070001; - public static final int ButtonBar=0x7f070003; - public static final int ButtonBarButton=0x7f070004; - public static final int FullscreenActionBarStyle=0x7f070005; - public static final int FullscreenTheme=0x7f070002; - public static final int LoginFormContainer=0x7f070006; - } - public static final class styleable { - /** - Declare custom theme attributes that allow changing which styles are - used for button bars depending on the API level. - ?android:attr/buttonBarStyle is new as of API 11 so this is - necessary to support previous API levels. - -

Includes the following attributes:

- - - - - - -
AttributeDescription
{@link #ButtonBarContainerTheme_buttonBarButtonStyle com.shaketobugsample.android:buttonBarButtonStyle}
{@link #ButtonBarContainerTheme_buttonBarStyle com.shaketobugsample.android:buttonBarStyle}
- @see #ButtonBarContainerTheme_buttonBarButtonStyle - @see #ButtonBarContainerTheme_buttonBarStyle - */ - public static final int[] ButtonBarContainerTheme = { - 0x7f010000, 0x7f010001 - }; - /** -

This symbol is the offset where the {@link com.shaketobugsample.android.R.attr#buttonBarButtonStyle} - attribute's value can be found in the {@link #ButtonBarContainerTheme} array. - - -

Must be a reference to another resource, in the form "@[+][package:]type:name" -or to a theme attribute in the form "?[package:][type:]name". - @attr name com.shaketobugsample.android:buttonBarButtonStyle - */ - public static final int ButtonBarContainerTheme_buttonBarButtonStyle = 1; - /** -

This symbol is the offset where the {@link com.shaketobugsample.android.R.attr#buttonBarStyle} - attribute's value can be found in the {@link #ButtonBarContainerTheme} array. - - -

Must be a reference to another resource, in the form "@[+][package:]type:name" -or to a theme attribute in the form "?[package:][type:]name". - @attr name com.shaketobugsample.android:buttonBarStyle - */ - public static final int ButtonBarContainerTheme_buttonBarStyle = 0; - }; -}