Skip to content

Commit 305ff3c

Browse files
committed
Merge branch 'ishaan1995-master' into bug-fixes
2 parents e5415eb + b24af77 commit 305ff3c

102 files changed

Lines changed: 1328 additions & 1192 deletions

File tree

Some content is hidden

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

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.org/BuildmLearn/BuildmLearn-Toolkit-Android.svg)](https://travis-ci.org/BuildmLearn/BuildmLearn-Toolkit-Android) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/05c83f4ecad84cc0a2e57d7ea39df41f)](https://www.codacy.com/app/anupam/BuildmLearn-Toolkit-Android?utm_source=github.com&utm_medium=referral&utm_content=BuildmLearn/BuildmLearn-Toolkit-Android&utm_campaign=Badge_Grade)
1+
[![Preview the app](https://img.shields.io/badge/Preview-Appetize.io-green.svg)](https://appetize.io/app/k56b095hpt7ppmhmmhbg2ayj20) [![Build Status](https://travis-ci.org/BuildmLearn/BuildmLearn-Toolkit-Android.svg)](https://travis-ci.org/BuildmLearn/BuildmLearn-Toolkit-Android) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/05c83f4ecad84cc0a2e57d7ea39df41f)](https://www.codacy.com/app/anupam/BuildmLearn-Toolkit-Android?utm_source=github.com&utm_medium=referral&utm_content=BuildmLearn/BuildmLearn-Toolkit-Android&utm_campaign=Badge_Grade)
22

33
# BuildmLearn-Toolkit-Android
44

@@ -70,3 +70,9 @@ Redistributions in binary form must reproduce the above copyright notice, this l
7070
Neither the name of the BuildmLearn nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
7171

7272
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
73+
74+
## Maintainers
75+
The project is maintained by
76+
- Pankaj Nathani ([@croozeus](https://github.com/croozeus))
77+
- Anupam Das ([@opticod](https://github.com/opticod))
78+

source-code/app/build.gradle

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ dependencies {
5555
compile 'com.android.support:cardview-v7:23.4.0'
5656
compile 'com.android.support:recyclerview-v7:23.4.0'
5757
compile 'com.android.support:design:23.4.0'
58-
compile('com.github.afollestad.material-dialogs:core:0.8.5.3@aar') {
59-
transitive = true
60-
}
61-
compile('com.github.afollestad.material-dialogs:commons:0.8.5.3@aar') {
62-
transitive = true
63-
}
6458
compile 'com.cocosw:bottomsheet:1.3.0@aar'
6559
compile('com.crashlytics.sdk.android:crashlytics:2.3.1@aar') {
6660
transitive = true;

source-code/app/src/main/java/org/buildmlearn/toolkit/ToolkitApplication.java

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
/**
1212
* @brief Extended Application class
13-
*
14-
*
13+
* <p/>
14+
* <p/>
1515
* Created by Abhishek on 31-05-2015.
1616
*/
1717
public class ToolkitApplication extends Application {
@@ -20,6 +20,13 @@ public class ToolkitApplication extends Application {
2020

2121
private boolean isExternalStorageAvailable = false;
2222

23+
/**
24+
* @return Folder path
25+
* @brief Returns folder path for unzipped apks
26+
*/
27+
public static String getUnZipDir() {
28+
return dir + Constants.UNZIP;
29+
}
2330

2431
@Override
2532
public void onCreate() {
@@ -48,58 +55,49 @@ public void onCreate() {
4855
}
4956

5057
/**
51-
* @brief Returns external storage directory.
5258
* @return folder file
59+
* @brief Returns external storage directory.
5360
*/
5461
public File getDir() {
5562
return Environment.getExternalStorageDirectory();
5663
}
5764

5865
/**
59-
* @brief Returns directory for BuildmLearn toolkit manually created files.
6066
* @return folder path
67+
* @brief Returns directory for BuildmLearn toolkit manually created files.
6168
*/
6269
public String getProjectDir() {
6370
return dir + Constants.BUILD_M_LEARN_PATH;
6471

6572
}
6673

6774
/**
68-
* @brief Returns folder path for saved projects
6975
* @return Folder path
76+
* @brief Returns folder path for saved projects
7077
*/
7178
public String getSavedDir() {
7279
return dir + Constants.SAVED_DIR;
7380
}
7481

7582
/**
76-
* @brief Returns folder path for saved projects
7783
* @return Folder path
84+
* @brief Returns folder path for saved projects
7885
*/
7986
public String getDraftDir() {
8087
return dir + Constants.DRAFT_DIR;
8188
}
8289

83-
8490
/**
85-
* @brief Returns folder path for unzipped apks
8691
* @return Folder path
87-
*/
88-
public static String getUnZipDir() {
89-
return dir + Constants.UNZIP;
90-
}
91-
92-
/**
9392
* @brief Returns folder path for storing generated apks
94-
* @return Folder path
9593
*/
9694
public String getApkDir() {
9795
return dir + Constants.APK_DIR;
9896
}
9997

10098
/**
101-
* @brief Checks if external storage is present for storing data
10299
* @return true if external storage is present, else false
100+
* @brief Checks if external storage is present for storing data
103101
*/
104102
public boolean checkExternalStorage() {
105103

@@ -117,8 +115,8 @@ public boolean isExternalStorageAvailable() {
117115
}
118116

119117
/**
120-
* @brief Returns folder path for Download directory
121118
* @return Folder path
119+
* @brief Returns folder path for Download directory
122120
*/
123121
public String getDownloadDirectory() {
124122
return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath();

source-code/app/src/main/java/org/buildmlearn/toolkit/activity/AboutBuildmLearn.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,11 @@ protected void onCreate(Bundle savedInstanceState) {
3636
} catch (PackageManager.NameNotFoundException e) {
3737
assert findViewById(R.id.app_version) != null;
3838
assert ((TextView) findViewById(R.id.app_version)) != null;
39-
((TextView)findViewById(R.id.app_version)).setText("Version: 1.0");
39+
((TextView) findViewById(R.id.app_version)).setText("Version: 1.0");
4040
e.printStackTrace();
4141
}
4242

4343

44-
4544
}
4645

4746
}

source-code/app/src/main/java/org/buildmlearn/toolkit/activity/DeepLinkerActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
/**
2424
* @brief Activity responsible for handling files opened from file explorer
25-
*
25+
* <p/>
2626
* This activity is started whenever users opens a .buildmlearn file from file explorer.
2727
* This activity is responsible for getting the template type from the file, and passes the template Id and
2828
* file path to Template Editor/ activity.

source-code/app/src/main/java/org/buildmlearn/toolkit/activity/HomeActivity.java

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -47,46 +47,40 @@ protected void onCreate(Bundle savedInstanceState) {
4747
mNavigationDrawerFragment.setUp(
4848
R.id.navigation_drawer,
4949
(DrawerLayout) findViewById(R.id.drawer_layout));
50-
if (getIntent().hasExtra(Constants.START_FRAGMENT)) {
51-
if (getIntent().getIntExtra(Constants.START_FRAGMENT, 0) == 3) {
52-
currentSection.setIsSelected(false);
53-
Section[] menuItem = Section.values();
54-
Section selectedMenuItem = menuItem[3];
55-
selectedMenuItem.setIsSelected(true);
56-
currentSection = selectedMenuItem;
57-
FragmentTransaction ft = getFragmentManager().beginTransaction();
58-
ft.replace(R.id.container, new SettingsFragment());
59-
ft.commit();
60-
}
50+
if (getIntent().hasExtra(Constants.START_FRAGMENT) && getIntent().getIntExtra(Constants.START_FRAGMENT, 0) == 3) {
51+
currentSection.setIsSelected(false);
52+
Section[] menuItem = Section.values();
53+
Section selectedMenuItem = menuItem[3];
54+
selectedMenuItem.setIsSelected(true);
55+
currentSection = selectedMenuItem;
56+
FragmentTransaction ft = getFragmentManager().beginTransaction();
57+
ft.replace(R.id.container, new SettingsFragment());
58+
ft.commit();
6159
}
6260
}
61+
6362
/**
6463
* {@inheritDoc}
6564
*/
6665
@Override
6766
public void onNavigationDrawerItemSelected(int position) {
68-
if(position==-1)
69-
{
70-
if(currentSection!=null)
71-
{
72-
if(currentSection.toString().equals("OPEN_PROJECT"))
73-
{
74-
LoadProjectFragment f = (LoadProjectFragment)getFragmentManager().findFragmentByTag(currentSection.getViewName());
75-
if(f!=null)
67+
if (position == -1) {
68+
if (currentSection != null) {
69+
if (currentSection.toString().equals("OPEN_PROJECT")) {
70+
LoadProjectFragment f = (LoadProjectFragment) getFragmentManager().findFragmentByTag(currentSection.getViewName());
71+
if (f != null)
7672
f.closeSearch();
77-
}
78-
else if(currentSection.toString().equals("OPEN_APK"))
79-
{
80-
LoadApkFragment f = (LoadApkFragment)getFragmentManager().findFragmentByTag(currentSection.getViewName());
81-
if(f!=null)
73+
} else if (currentSection.toString().equals("OPEN_APK")) {
74+
LoadApkFragment f = (LoadApkFragment) getFragmentManager().findFragmentByTag(currentSection.getViewName());
75+
if (f != null)
8276
f.closeSearch();
8377
}
8478
}
85-
return ;
79+
return;
8680
}
8781
Section[] menuItem = Section.values();
8882
Section selectedMenuItem = menuItem[position];
89-
if(getSupportActionBar()!=null) {
83+
if (getSupportActionBar() != null) {
9084
getSupportActionBar().setDisplayShowHomeEnabled(true);
9185
getSupportActionBar().setDisplayShowCustomEnabled(false);
9286
}
@@ -103,7 +97,7 @@ else if(currentSection.toString().equals("OPEN_APK"))
10397
}
10498
}
10599
} else if (selectedMenuItem.getType() == Section.FRAGMENT) {
106-
if (currentSection == null || selectedMenuItem != currentSection) {
100+
if (currentSection == null || !selectedMenuItem.equals(currentSection)) {
107101
currentSection = selectedMenuItem;
108102
FragmentManager fm = getFragmentManager();
109103
FragmentTransaction ft = fm.beginTransaction().setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE).addToBackStack(null);

source-code/app/src/main/java/org/buildmlearn/toolkit/activity/SettingsLinkerActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
/**
1414
* @brief Activity responsible for changing settings from android settings menu
15-
* <p>
15+
* <p/>
1616
* This activity is started whenever users clicks App Settings under App notifications in android settings menu.
1717
*/
1818
public class SettingsLinkerActivity extends Activity {

0 commit comments

Comments
 (0)