Skip to content

Commit d555990

Browse files
committed
Use Instabug v3
1 parent d43a26c commit d555990

File tree

11 files changed

+138
-116
lines changed

11 files changed

+138
-116
lines changed

CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
Change Log
22
==========
33

4-
Version 2.6.0 *(2016-08-03)*
4+
5+
Version 3.0.0 *(2016-10-16)*
6+
----------------------------
7+
8+
* We have completely redesigned how the SDK looks and given you even more customization options to better fit the style of your app.
9+
* Added the ability to attach a screen recording to bug reports and conversations.
10+
* Enhanced our in-app messaging experience to enable users to start conversations with your team right from your app, complete with screenshots, screen recordings and voice notes attachments support.
11+
* We have localized the SDK into new languages. We now support a total of 20 languages.
12+
13+
Version 2.6.2 *(2016-09-09)*
14+
----------------------------
15+
16+
* Bug fixes
17+
18+
19+
Version 2.6.1 *(2016-08-03)*
520
----------------------------
621

722
* Bug fixes

README.md

Lines changed: 8 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -12,57 +12,29 @@ Using Instabug is as easy as "Get ready, Get set, Go".
1212
1. <b>Determining which Instabug flavour to use</b> (Getting ready)
1313
* If your `minSdkVersion` is `14+`:
1414

15-
Use `instabug` flavour
15+
Check `Above14` flavour
1616

1717
* If your `minSdkVersion` is `10+`:
18-
19-
* If you're using Google support libraries (`com.android.support:*`):
20-
21-
Use `instabugcompat` flavour
22-
23-
* If you're using [ActionBarSherlock](https://github.com/JakeWharton/ActionBarSherlock):
24-
25-
Use `instabugabs` flavour
18+
19+
Check `belowApi14` flavour
2620

2721
1. <b>Adding Instabug to your dependencies</b> (Getting set)
2822

2923
Grab your desired flavour via Gradle:
3024
```groovy
31-
compile 'com.instabug.library:instabug:2.6.1'
25+
compile 'com.instabug.library:instabug:3.0.0'
3226
```
33-
or
34-
```groovy
35-
compile 'com.instabug.library:instabugcompat:2.6.1'
36-
```
37-
or
38-
```groovy
39-
compile 'com.instabug.library:instabugabs:2.6.1'
27+
4028
```
4129
or via Maven: (if you're that kind of person :bowtie:)
4230
```xml
4331
<dependency>
4432
<groupId>com.instabug.library</groupId>
4533
<artifactId>instabug</artifactId>
46-
<version>2.6.1</version>
47-
</dependency>
48-
```
49-
or
50-
```xml
51-
<dependency>
52-
<groupId>com.instabug.library</groupId>
53-
<artifactId>instabugcompat</artifactId>
54-
<version>2.6.1</version>
55-
</dependency>
56-
```
57-
or
58-
```xml
59-
<dependency>
60-
<groupId>com.instabug.library</groupId>
61-
<artifactId>instabugabs</artifactId>
62-
<version>2.6.1</version>
34+
<version>3.0.0</version>
6335
</dependency>
6436
```
65-
37+
6638
1. <b>Using Instabug</b> (Good to go!)
6739
6840
* Initializing Instabug:
@@ -74,28 +46,11 @@ Using Instabug is as easy as "Get ready, Get set, Go".
7446
super.onCreate();
7547
// ...
7648
new Instabug.Builder(this, "<YOUR_APP_TOKEN>")
77-
.setInvocationEvent(IBGInvocationEvent.IBGInvocationEventFloatingButton)
49+
.setInvocationEvent(InstabugInvocationEvent.InstabugInvocationEventFloatingButton)
7850
.build();
7951
// ...
8052
}
8153
```
82-
* Extending Instabug Activities:
83-
84-
**ONLY** if your `minSdkVersion` is **`10+`** should you extend `Instabug*Activity`
85-
* If you're using `instabugcompat`:
86-
* `InstabugAppCompatActivity`: extends `android.support.v7.app.AppCompatActivity`
87-
* `InstabugActionBarActivity`: extends `android.support.v7.app.ActionBarActivity`
88-
* `InstabugActivity`: extends `android.app.activity`
89-
* `InstabugFragmentActivity`: extends `android.support.v4.app.FragmentActivity`
90-
* `InstabugExpandableListActivity`: extends `android.app.ExpandableListActivity`
91-
* `InstabugListActivity`: extends `android.app.ListActivity`
92-
* `InstabugPreferenceActivity`: extends `android.preference.PreferenceActivity`
93-
* If you're using `instabugabs`:
94-
* `InstabugSherlockActivity`: extends `com.actionbarsherlock.app.SherlockActivity`
95-
* `InstabugSherlockFragmentActivity`: extends `com.actionbarsherlock.app.SherlockFragmentActivity`
96-
* `InstabugSherlockExpandableListActivity`: extends `com.actionbarsherlock.app.SherlockExpandableListActivity`
97-
* `InstabugSherlockListActivity`: extends `com.actionbarsherlock.app.SherlockListActivity`
98-
* `InstabugSherlockPreferenceActivity`: extends `com.actionbarsherlock.app.SherlockPreferenceActivity`
9954
10055
For technical documentation and FAQs check the [wiki][wiki]
10156

app/build.gradle

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@ android {
1818
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
1919
}
2020
}
21+
22+
productFlavors {
23+
aboveApi14{
24+
minSdkVersion 15
25+
applicationId "com.example.instabug.above4"
26+
versionName "1.0-aboveApi14"
27+
}
28+
belowApi14 {
29+
minSdkVersion 10
30+
applicationId "com.example.instabug.below14"
31+
versionName "1.0-belowApi14"
32+
}
33+
}
2134
}
2235

2336
repositories {
@@ -30,7 +43,6 @@ repositories {
3043

3144
dependencies {
3245
compile fileTree(dir: 'libs', include: ['*.jar'])
33-
testCompile 'junit:junit:4.12'
3446
compile 'com.android.support:multidex:1.0.1'
3547
compile 'com.jakewharton:butterknife:7.0.1'
3648
compile 'com.android.support:design:23.2.0'
@@ -40,13 +52,12 @@ dependencies {
4052
// TODO add the following 2 lines if you exclude io.reactivex from Instabug
4153
// compile 'io.reactivex:rxjava:1.0.13'
4254
// compile 'io.reactivex:rxandroid:1.0.1'
43-
compile('com.instabug.library:instabug:2.6.1') {
55+
compile('com.instabug.library:instabug:3.0.0') {
4456
// TODO uncomment this line to exclude RxJava from Instabug and use your own version
4557
// exclude group: 'io.reactivex'
4658

47-
exclude group: 'com.android.support'
4859
// TODO uncomment next line if you're facing compilation issue in build.gradle about gms different versions
49-
// exclude group: 'com.google.android.gms'
60+
exclude group: 'com.android.support'
5061
}
5162

5263

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.example.instabug;
2+
3+
import android.support.v7.app.AppCompatActivity;
4+
import android.view.MotionEvent;
5+
6+
import com.instabug.library.InstabugTrackingDelegate;
7+
8+
/**
9+
* Created by vezikon on 10/15/16.
10+
*/
11+
12+
public class BaseActivity extends AppCompatActivity {
13+
14+
@Override
15+
public boolean dispatchTouchEvent(MotionEvent ev) {
16+
//To allow instabug to track user steps
17+
// and also add touches to screen recording
18+
InstabugTrackingDelegate.notifyActivityGotTouchEvent(ev, this);
19+
return super.dispatchTouchEvent(ev);
20+
}
21+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package com.example.instabug;
2+
3+
import android.os.Bundle;
4+
import android.support.v7.app.AppCompatActivity;
5+
import android.view.MotionEvent;
6+
7+
import com.instabug.library.InstabugTrackingDelegate;
8+
9+
10+
/**
11+
* For below API 14 support you need to manually track
12+
* the lifecycle of the activity
13+
*/
14+
public class BaseActivity extends AppCompatActivity {
15+
@Override
16+
protected void onCreate(Bundle savedInstanceState) {
17+
super.onCreate(savedInstanceState);
18+
InstabugTrackingDelegate.notifyActivityCreated(this);
19+
}
20+
21+
@Override
22+
protected void onStart() {
23+
super.onStart();
24+
InstabugTrackingDelegate.notifyActivityStarted(this);
25+
}
26+
27+
@Override
28+
protected void onResume() {
29+
super.onResume();
30+
InstabugTrackingDelegate.notifyActivityResumed(this);
31+
}
32+
33+
@Override
34+
protected void onPause() {
35+
super.onPause();
36+
InstabugTrackingDelegate.notifyActivityPaused(this);
37+
}
38+
39+
@Override
40+
protected void onStop() {
41+
super.onStop();
42+
InstabugTrackingDelegate.notifyActivityCreated(this);
43+
}
44+
45+
@Override
46+
protected void onDestroy() {
47+
super.onDestroy();
48+
InstabugTrackingDelegate.notifyActivityDestroyed(this);
49+
}
50+
51+
@Override
52+
public boolean dispatchTouchEvent(MotionEvent ev) {
53+
//To allow instabug to track user steps
54+
// and also add touches to screen recording
55+
InstabugTrackingDelegate.notifyActivityGotTouchEvent(ev, this);
56+
return super.dispatchTouchEvent(ev);
57+
}
58+
}

app/src/main/java/com/example/instabug/SampleApplication.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
import com.instabug.library.IBGCustomTextPlaceHolder;
88
import com.instabug.library.IBGInvocationEvent;
99
import com.instabug.library.Instabug;
10+
import com.instabug.library.InstabugColorTheme;
11+
import com.instabug.library.InstabugCustomTextPlaceHolder;
1012
import com.instabug.library.internal.module.InstabugLocale;
13+
import com.instabug.library.invocation.InstabugInvocationEvent;
1114

1215
import java.security.KeyFactory;
1316
import java.util.Locale;
@@ -21,22 +24,24 @@ public void onCreate() {
2124
super.onCreate();
2225
MultiDex.install(this);
2326
new Instabug.Builder(this, "f501f761142981d54b1fdea93963a934")
24-
.setDebugEnabled(true)
2527
.setEmailFieldRequired(false)
2628
.setFloatingButtonOffsetFromTop(400)
27-
.setColorTheme(IBGColorTheme.IBGColorThemeLight)
28-
.setShouldShowIntroDialog(false)
29-
.setInvocationEvent(IBGInvocationEvent.IBGInvocationEventShake)
29+
.setTheme(InstabugColorTheme.InstabugColorThemeLight)
30+
.setIntroMessageEnabled(false)
31+
.setInvocationEvent(InstabugInvocationEvent.SHAKE)
32+
.setAttachmentTypesEnabled(true, true, true, true, true)
3033
// TODO the following are 3 acceptable ways to force Locale in Instabug (last one is the only 1 applied)
3134
.setLocale(new Locale(InstabugLocale.SIMPLIFIED_CHINESE.getCode(), InstabugLocale.SIMPLIFIED_CHINESE.getCountry()))
3235
.setLocale(new Locale(InstabugLocale.FRENCH.getCode()))
3336
.setLocale(Locale.GERMAN)
3437
.build();
3538

39+
Instabug.setDebugEnabled(true);
40+
3641
//Settings custom strings to replace instabug's strings
37-
IBGCustomTextPlaceHolder placeHolder = new IBGCustomTextPlaceHolder();
38-
placeHolder.set(IBGCustomTextPlaceHolder.Key.REPORT_FEEDBACK, "Send Feedback");
39-
placeHolder.set(IBGCustomTextPlaceHolder.Key.REPORT_BUG, "Send Bug Report");
42+
InstabugCustomTextPlaceHolder placeHolder = new InstabugCustomTextPlaceHolder();
43+
placeHolder.set(InstabugCustomTextPlaceHolder.Key.REPORT_FEEDBACK, "Send Feedback");
44+
placeHolder.set(InstabugCustomTextPlaceHolder.Key.REPORT_BUG, "Send Bug Report");
4045

4146
Instabug.setCustomTextPlaceHolders(placeHolder);
4247
}

app/src/main/java/com/example/instabug/ui/activities/GoogleMapsActivity.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@
22

33
import android.net.Uri;
44
import android.os.Bundle;
5-
import android.support.v7.app.AppCompatActivity;
65
import android.view.View;
76
import android.widget.Toast;
87

8+
import com.example.instabug.BaseActivity;
99
import com.example.instabug.R;
10-
import com.example.instabug.ui.views.CustomGoogleMap;
1110
import com.google.android.gms.maps.GoogleMap;
1211
import com.google.android.gms.maps.OnMapReadyCallback;
1312
import com.google.android.gms.maps.SupportMapFragment;
1413
import com.google.android.gms.maps.model.LatLng;
1514
import com.google.android.gms.maps.model.MarkerOptions;
1615
import com.instabug.library.Instabug;
1716

18-
public class GoogleMapsActivity extends AppCompatActivity implements OnMapReadyCallback {
17+
public class GoogleMapsActivity extends BaseActivity implements OnMapReadyCallback {
1918

2019
private GoogleMap mMap; // Might be null if Google Play services APK is not available.
2120
private SupportMapFragment mapFragment;
@@ -50,10 +49,6 @@ private void setUpMap() {
5049
@Override
5150
public void onMapReady(GoogleMap googleMap) {
5251
mMap = googleMap;
53-
CustomGoogleMap customGoogleMap = new CustomGoogleMap(mapFragment.getView(), mMap);
54-
// TODO add this so that instabug recognizes you have a map and show it in the screenshot
55-
Instabug.addCapturableView(customGoogleMap);
56-
5752
setUpMap();
5853
}
5954
}

app/src/main/java/com/example/instabug/ui/activities/MainActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
import android.support.v4.view.GravityCompat;
1010
import android.support.v4.widget.DrawerLayout;
1111
import android.support.v7.app.ActionBarDrawerToggle;
12-
import android.support.v7.app.AppCompatActivity;
1312
import android.support.v7.widget.Toolbar;
1413
import android.view.Menu;
1514
import android.view.MenuItem;
1615
import android.view.View;
1716
import android.widget.ImageView;
1817
import android.widget.Toast;
1918

19+
import com.example.instabug.BaseActivity;
2020
import com.example.instabug.R;
2121
import com.example.instabug.gcm.RegistrationIntentService;
2222
import com.instabug.library.Instabug;
@@ -25,7 +25,7 @@
2525
import butterknife.ButterKnife;
2626
import butterknife.OnClick;
2727

28-
public class MainActivity extends AppCompatActivity
28+
public class MainActivity extends BaseActivity
2929
implements NavigationView.OnNavigationItemSelectedListener {
3030

3131
@Bind(R.id.drawer_layout)

app/src/main/java/com/example/instabug/ui/activities/OpenGLActivity.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
import android.opengl.GLSurfaceView;
66
import android.opengl.Matrix;
77
import android.os.Bundle;
8-
import android.support.v7.app.ActionBarActivity;
98
import android.util.Log;
109
import android.view.MotionEvent;
1110
import android.widget.FrameLayout;
1211

12+
import com.example.instabug.BaseActivity;
1313
import com.example.instabug.R;
14-
import com.instabug.library.Instabug;
1514

1615
import java.nio.ByteBuffer;
1716
import java.nio.ByteOrder;
@@ -22,7 +21,7 @@
2221
import javax.microedition.khronos.opengles.GL10;
2322

2423

25-
public class OpenGLActivity extends ActionBarActivity {
24+
public class OpenGLActivity extends BaseActivity {
2625

2726
private GLSurfaceView mGLView;
2827

@@ -37,7 +36,6 @@ public void onCreate(Bundle savedInstanceState) {
3736
// as the ContentView for this Activity
3837
mGLView = new MyGLSurfaceView(this);
3938
// TODO add this so that instabug recognizes you have an OpenGL surface and show it in the screenshot
40-
Instabug.setGLSurfaceView(mGLView);
4139
mainLayout.addView(mGLView, 0);
4240
}
4341

0 commit comments

Comments
 (0)