Skip to content

Commit 430163d

Browse files
authored
Merge pull request #40 from SureshCS-50/master
Issue fixes
2 parents 15609a5 + 6e53789 commit 430163d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1398
-1150
lines changed

HelpStackExample/AndroidManifest.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
android:minSdkVersion="9"
99
android:targetSdkVersion="22" />
1010

11-
<uses-permission android:name="android.permission.INTERNET"/>
11+
<uses-permission android:name="android.permission.INTERNET" />
1212

1313
<application
1414
android:allowBackup="true"
@@ -24,7 +24,9 @@
2424
<category android:name="android.intent.category.LAUNCHER" />
2525
</intent-filter>
2626
</activity>
27-
<meta-data android:name="com.crashlytics.ApiKey" android:value="1d530866e0cb30a5451eee4b86edfa0e9f13de4a"/>
27+
<meta-data
28+
android:name="io.fabric.ApiKey"
29+
android:value="1d530866e0cb30a5451eee4b86edfa0e9f13de4a" />
2830
</application>
2931

3032
</manifest>

HelpStackExample/build.gradle

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
1+
buildscript {
2+
repositories {
3+
jcenter();
4+
maven { url 'https://maven.fabric.io/public' }
5+
}
6+
7+
dependencies {
8+
classpath 'io.fabric.tools:gradle:1.20.1'
9+
classpath 'com.google.gms:google-services:2.0.0-beta2'
10+
}
11+
}
12+
113
apply plugin: 'com.android.application'
14+
apply plugin: 'io.fabric'
15+
16+
repositories {
17+
mavenCentral()
18+
maven { url 'https://maven.fabric.io/public' }
19+
}
220

321
dependencies {
422
compile fileTree(dir: 'libs', include: '*.jar')
523
compile project(':helpstack')
6-
724
compile 'com.android.support:appcompat-v7:23.0.0'
25+
compile('com.crashlytics.sdk.android:crashlytics:2.6.1@aar') {
26+
transitive = true;
27+
}
828
}
929

1030
android {
@@ -40,4 +60,5 @@ android {
4060
exclude 'META-INF/NOTICE'
4161
exclude 'META-INF/LICENSE'
4262
}
63+
4364
}
-191 KB
Binary file not shown.
Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
1-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
1+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
22
xmlns:tools="http://schemas.android.com/tools"
3+
android:orientation="vertical"
34
android:layout_width="match_parent"
45
android:layout_height="match_parent"
56
android:paddingBottom="@dimen/activity_vertical_margin"
67
android:paddingLeft="@dimen/activity_horizontal_margin"
78
android:paddingRight="@dimen/activity_horizontal_margin"
89
android:paddingTop="@dimen/activity_vertical_margin"
10+
android:gravity="center"
911
tools:context="com.example.helpstackexample.MainActivity$PlaceholderFragment" >
1012

1113
<Button
1214
android:id="@+id/button1"
1315
android:layout_width="wrap_content"
1416
android:layout_height="wrap_content"
15-
android:layout_centerHorizontal="true"
16-
android:layout_marginTop="30dp"
1717
android:text="@string/show_help" />
1818

19-
</RelativeLayout>
19+
20+
<Button
21+
android:id="@+id/btnClearCache"
22+
android:layout_width="wrap_content"
23+
android:layout_height="wrap_content"
24+
android:layout_marginTop="30dp"
25+
android:text="@string/clear_cache" />
26+
27+
</LinearLayout>

HelpStackExample/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
<string name="hello_world">Hello world!</string>
66
<string name="action_settings">Settings</string>
77
<string name="show_help">Show Help</string>
8+
<string name="clear_cache">Clear Cache</string>
89

910
</resources>

HelpStackExample/src/com/example/helpstackexample/HSApplication.java

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,25 @@
22

33
import android.app.Application;
44

5+
import com.crashlytics.android.Crashlytics;
56
import com.tenmiles.helpstack.HSHelpStack;
67
import com.tenmiles.helpstack.gears.HSEmailGear;
78

9+
import io.fabric.sdk.android.Fabric;
10+
811
public class HSApplication extends Application {
912

10-
HSHelpStack helpStack;
13+
public static HSHelpStack helpStack;
1114

12-
@Override
13-
public void onCreate() {
14-
super.onCreate();
15+
@Override
16+
public void onCreate() {
17+
super.onCreate();
1518

16-
helpStack = HSHelpStack.getInstance(this);
19+
Fabric.with(this, new Crashlytics());
20+
helpStack = HSHelpStack.getInstance(this);
1721

18-
HSEmailGear emailGear = new HSEmailGear("foo@bar.com", R.xml.articles);
19-
helpStack.setGear(emailGear);
22+
HSEmailGear emailGear = new HSEmailGear("foo@bar.com", R.xml.articles);
23+
helpStack.setGear(emailGear);
2024

2125
/* Uncomment the following to use the HappyFox gear with appropriate support email address */
2226

@@ -28,5 +32,7 @@ public void onCreate() {
2832
// "<Priority ID>");
2933
//
3034
// helpStack.setGear(happyfoxGear);
31-
}
35+
36+
}
37+
3238
}

HelpStackExample/src/com/example/helpstackexample/MainActivity.java

Lines changed: 51 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -10,61 +10,66 @@
1010
import android.view.View.OnClickListener;
1111
import android.view.ViewGroup;
1212

13-
import com.crashlytics.android.Crashlytics;
1413
import com.tenmiles.helpstack.HSHelpStack;
1514

1615
public class MainActivity extends AppCompatActivity {
1716

18-
@Override
19-
protected void onCreate(Bundle savedInstanceState) {
20-
super.onCreate(savedInstanceState);
21-
Crashlytics.start(this);
22-
setContentView(R.layout.activity_main);
17+
@Override
18+
protected void onCreate(Bundle savedInstanceState) {
19+
super.onCreate(savedInstanceState);
20+
setContentView(R.layout.activity_main);
2321

24-
if (savedInstanceState == null) {
25-
getSupportFragmentManager().beginTransaction().add(R.id.container, new PlaceholderFragment()).commit();
26-
}
27-
28-
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
29-
getSupportActionBar().setDisplayUseLogoEnabled(false);
30-
getSupportActionBar().setIcon(R.color.hs_transparent_color);
31-
}
22+
if (savedInstanceState == null) {
23+
getSupportFragmentManager().beginTransaction().add(R.id.container, new PlaceholderFragment()).commit();
24+
}
3225

33-
@Override
34-
public boolean onCreateOptionsMenu(Menu menu) {
35-
getMenuInflater().inflate(R.menu.main, menu);
36-
return true;
37-
}
26+
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
27+
getSupportActionBar().setDisplayUseLogoEnabled(false);
28+
getSupportActionBar().setIcon(R.color.hs_transparent_color);
29+
}
3830

39-
@Override
40-
public boolean onOptionsItemSelected(MenuItem item) {
41-
int id = item.getItemId();
42-
if (id == R.id.action_settings) {
43-
return true;
44-
}
45-
return super.onOptionsItemSelected(item);
46-
}
31+
@Override
32+
public boolean onCreateOptionsMenu(Menu menu) {
33+
getMenuInflater().inflate(R.menu.main, menu);
34+
return true;
35+
}
4736

48-
/**
49-
* A placeholder fragment containing a simple view.
50-
*/
51-
public static class PlaceholderFragment extends Fragment {
37+
@Override
38+
public boolean onOptionsItemSelected(MenuItem item) {
39+
int id = item.getItemId();
40+
if (id == R.id.action_settings) {
41+
return true;
42+
}
43+
return super.onOptionsItemSelected(item);
44+
}
5245

53-
public PlaceholderFragment() {
54-
}
46+
/**
47+
* A placeholder fragment containing a simple view.
48+
*/
49+
public static class PlaceholderFragment extends Fragment {
5550

56-
@Override
57-
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
58-
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
59-
rootView.findViewById(R.id.button1).setOnClickListener(new OnClickListener() {
60-
61-
@Override
62-
public void onClick(View v) {
63-
HSHelpStack.getInstance(getActivity()).showHelp(getActivity());
64-
}
65-
});
66-
return rootView;
67-
}
68-
}
51+
public PlaceholderFragment() {
52+
}
53+
54+
@Override
55+
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
56+
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
57+
rootView.findViewById(R.id.button1).setOnClickListener(new OnClickListener() {
58+
59+
@Override
60+
public void onClick(View v) {
61+
HSHelpStack.getInstance(getActivity()).showHelp(getActivity());
62+
}
63+
});
64+
rootView.findViewById(R.id.btnClearCache).setOnClickListener(new OnClickListener() {
65+
66+
@Override
67+
public void onClick(View v) {
68+
HSHelpStack.getInstance(getActivity()).clear(getActivity());
69+
}
70+
});
71+
return rootView;
72+
}
73+
}
6974

7075
}

Themes/HSDarkTheme/values/hs_custom_theme.xml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,7 @@
6767
<style name="hs_messageEditTextStyle" parent="hs_editText_defaultStyle"></style>
6868

6969
<!-- DRAWABLES
70-
Defining the drawable icons used in the project, override the drawable to give your own custom icons
71-
72-
Attachment icon used in New Issue screen, and chat screen to show attachments -->
73-
<drawable name="hs_attachment_icon">@drawable/hs_attachment_img</drawable>
74-
75-
<!-- Search icon used in search menu -->
76-
<drawable name="hs_search_icon">@drawable/hs_search_img_light</drawable>
77-
78-
<!-- Disclosure icon used in main list view -->
79-
<drawable name="hs_disclosure_next">@drawable/hs_disclosure_img</drawable>
70+
Defining the drawable icons used in the project, override the drawable to give your own custom icons -->
8071

8172
<!-- Add attachment icon used in issue detail screen - add reply -->
8273
<drawable name="hs_add_attachment">@drawable/hs_add_attachment_img</drawable>

Themes/HSFacebookTheme/values/hs_custom_theme.xml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,7 @@
6868
<style name="hs_messageEditTextStyle" parent="hs_editText_defaultStyle"></style>
6969

7070
<!-- DRAWABLES
71-
Defining the drawable icons used in the project, override the drawable to give your own custom icons
72-
73-
Attachment icon used in New Issue screen, and chat screen to show attachments -->
74-
<drawable name="hs_attachment_icon">@drawable/hs_attachment_img</drawable>
75-
76-
<!-- Search icon used in search menu -->
77-
<drawable name="hs_search_icon">@drawable/hs_search_img_light</drawable>
78-
79-
<!-- Disclosure icon used in main list view -->
80-
<drawable name="hs_disclosure_next">@drawable/hs_disclosure_img</drawable>
71+
Defining the drawable icons used in the project, override the drawable to give your own custom icons -->
8172

8273
<!-- Add attachment icon used in issue detail screen - add reply -->
8374
<drawable name="hs_add_attachment">@drawable/hs_add_attachment_img</drawable>

Themes/HSHalloweenTheme/values/hs_custom_theme.xml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,7 @@
6767
<style name="hs_messageEditTextStyle" parent="hs_editText_defaultStyle"></style>
6868

6969
<!-- DRAWABLES
70-
Defining the drawable icons used in the project, override the drawable to give your own custom icons
71-
72-
Attachment icon used in New Issue screen, and chat screen to show attachments -->
73-
<drawable name="hs_attachment_icon">@drawable/hs_attachment_img</drawable>
74-
75-
<!-- Search icon used in search menu -->
76-
<drawable name="hs_search_icon">@drawable/hs_search_img_light</drawable>
77-
78-
<!-- Disclosure icon used in main list view -->
79-
<drawable name="hs_disclosure_next">@drawable/hs_disclosure_img</drawable>
70+
Defining the drawable icons used in the project, override the drawable to give your own custom icons -->
8071

8172
<!-- Add attachment icon used in issue detail screen - add reply -->
8273
<drawable name="hs_add_attachment">@drawable/hs_add_attachment_img</drawable>

0 commit comments

Comments
 (0)