Skip to content

Commit 199f8b4

Browse files
author
Mohamed Sobhy
committed
Use v2.2 + Show setFileAttachment
1 parent 98128a1 commit 199f8b4

File tree

5 files changed

+47
-15
lines changed

5 files changed

+47
-15
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,38 +28,38 @@ Using Instabug is as easy as "Get ready, Get set, Go".
2828

2929
Grab your desired flavour via Gradle:
3030
```groovy
31-
compile 'com.instabug.library:instabug:2.1.1'
31+
compile 'com.instabug.library:instabug:2.2'
3232
```
3333
or
3434
```groovy
35-
compile 'com.instabug.library:instabugcompat:2.1.1'
35+
compile 'com.instabug.library:instabugcompat:2.2'
3636
```
3737
or
3838
```groovy
39-
compile 'com.instabug.library:instabugabs:2.1.1'
39+
compile 'com.instabug.library:instabugabs:2.2'
4040
```
4141
or via Maven: (if you're that kind of person :bowtie:)
4242
```xml
4343
<dependency>
4444
<groupId>com.instabug.library</groupId>
4545
<artifactId>instabug</artifactId>
46-
<version>2.1.1</version>
46+
<version>2.2</version>
4747
</dependency>
4848
```
4949
or
5050
```xml
5151
<dependency>
5252
<groupId>com.instabug.library</groupId>
5353
<artifactId>instabugcompat</artifactId>
54-
<version>2.1.1</version>
54+
<version>2.2</version>
5555
</dependency>
5656
```
5757
or
5858
```xml
5959
<dependency>
6060
<groupId>com.instabug.library</groupId>
6161
<artifactId>instabugabs</artifactId>
62-
<version>2.1.1</version>
62+
<version>2.2</version>
6363
</dependency>
6464
```
6565

app/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ dependencies {
3737
// TODO if you use a lower version than 8.4.0 you should uncomment the exclude line to avoid errors
3838
compile 'com.google.android.gms:play-services:8.4.0'
3939
// TODO add the following 2 lines if you exclude io.reactivex from Instabug
40-
compile 'io.reactivex:rxjava:1.0.13'
41-
compile 'io.reactivex:rxandroid:1.0.1'
42-
compile('com.instabug.library:instabug:2.1.1') {
43-
// TODO uncomment these 2 lines to exclude RxJava from Instabug and use your own version
44-
exclude group: 'io.reactivex'
40+
// compile 'io.reactivex:rxjava:1.0.13'
41+
// compile 'io.reactivex:rxandroid:1.0.1'
42+
compile('com.instabug.library:instabug:2.2') {
43+
// TODO uncomment this line to exclude RxJava from Instabug and use your own version
44+
// exclude group: 'io.reactivex'
4545

4646
exclude module: 'appcompat-v7'
4747
// TODO uncomment next line if you're facing compilation issue in build.gradle about gms different versions

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
package com.example.instabug.ui.activities;
22

3+
import android.net.Uri;
34
import android.os.Bundle;
45
import android.support.v7.app.AppCompatActivity;
6+
import android.view.View;
7+
import android.widget.Toast;
58

69
import com.example.instabug.R;
710
import com.example.instabug.ui.views.CustomGoogleMap;
@@ -20,6 +23,13 @@ public class GoogleMapsActivity extends AppCompatActivity {
2023
protected void onCreate(Bundle savedInstanceState) {
2124
super.onCreate(savedInstanceState);
2225
setContentView(R.layout.activity_maps);
26+
findViewById(R.id.attach_button).setOnClickListener(new View.OnClickListener() {
27+
@Override
28+
public void onClick(View v) {
29+
Instabug.setFileAttachment(Uri.parse("android.resource://com.example.instabug/" + R.raw.extra));
30+
Toast.makeText(GoogleMapsActivity.this, "File saved to be uploaded", Toast.LENGTH_SHORT).show();
31+
}
32+
});
2333
setUpMapIfNeeded();
2434
}
2535

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
1-
<fragment
2-
android:id="@+id/map"
3-
android:name="com.google.android.gms.maps.SupportMapFragment"
1+
<FrameLayout
2+
android:id="@+id/layout_main"
43
xmlns:android="http://schemas.android.com/apk/res/android"
54
xmlns:tools="http://schemas.android.com/tools"
65
android:layout_width="match_parent"
76
android:layout_height="match_parent"
8-
tools:context="com.example.instabug.GoogleMapsActivity"/>
7+
android:paddingBottom="@dimen/activity_vertical_margin"
8+
android:paddingLeft="@dimen/activity_horizontal_margin"
9+
android:paddingRight="@dimen/activity_horizontal_margin"
10+
android:paddingTop="@dimen/activity_vertical_margin"
11+
tools:context="com.example.instabug.OpenGLActivity">
12+
13+
<Button
14+
android:id="@+id/attach_button"
15+
android:layout_width="wrap_content"
16+
android:layout_height="wrap_content"
17+
android:layout_gravity="center_horizontal"
18+
android:text="Attach something with report"/>
19+
20+
<fragment
21+
android:id="@+id/map"
22+
android:name="com.google.android.gms.maps.SupportMapFragment"
23+
xmlns:android="http://schemas.android.com/apk/res/android"
24+
xmlns:tools="http://schemas.android.com/tools"
25+
android:layout_width="match_parent"
26+
android:layout_height="match_parent"
27+
tools:context="com.example.instabug.GoogleMapsActivity"/>
28+
29+
</FrameLayout>

app/src/main/res/raw/extra.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This contains extra secret stuff to attach to report!!!

0 commit comments

Comments
 (0)