Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
da9bc97
Added DictationModel.class
opticod Jul 4, 2016
e63647b
Added DictationAdapter.java
opticod Jul 4, 2016
ef4eae1
Added DictationTemplate.java
opticod Jul 4, 2016
6137843
Added dictation layouts + updated strings.xml
opticod Jul 4, 2016
da9624b
Added DictationTemplate in the template list
opticod Jul 4, 2016
bfcbded
Added dictation_content.xml
opticod Jul 10, 2016
a38f5be
Added DictationApp.apk
opticod Jul 10, 2016
93b5365
Added dictation simulator's adapter
opticod Jul 10, 2016
2e0ca91
Added dictation simulator's resource values
opticod Jul 10, 2016
f36a995
Added dictation simulator's layouts
opticod Jul 10, 2016
06c1783
Updated dictation template for simulator support and apk generation
opticod Jul 10, 2016
875f21e
Added dictation simulator's Utilities + constants
opticod Jul 10, 2016
14b5653
Added dictation simulator's data files
opticod Jul 10, 2016
0f61184
Added dictation simulator's frgaments
opticod Jul 11, 2016
78028cb
Added missing drawables
opticod Jul 11, 2016
96a29f2
FIXED #150 :: Wrong template Id is retrieved after loading a project.
opticod Jul 14, 2016
b7579ea
1. Reduced the distance between the cards. 2. Added Progress Bar to l…
opticod Jul 15, 2016
1d8989d
Adding Meta Base Adapter for Match The Following Template
opticod Jul 16, 2016
1737676
FIXED :: Project Deletion Crash of App
opticod Jul 16, 2016
3e6fde4
Added new designs for Match the following Template
opticod Jul 16, 2016
4093e5a
Adding Base Adapter for Match The Following Template
opticod Jul 16, 2016
70fe777
Adding Meta Base Model for Match The Following Template
opticod Jul 17, 2016
21491f9
Adding Base Model for Match The Following Template
opticod Jul 17, 2016
90b03fa
Adding main template file for Match The Following Template
opticod Jul 17, 2016
609e1c6
Adding meta layouts for Match The Following Template
opticod Jul 17, 2016
1a8e79e
Adding base layouts for Match The Following Template
opticod Jul 17, 2016
02b953e
Attaching Match the following template in template list
opticod Jul 18, 2016
8aa29fa
Added match_content basic xml
opticod Jul 28, 2016
6e17b87
Added MatchTemplateApp.apk
opticod Jul 28, 2016
3c6cccd
Updated colors.xml + dimens.xml + strings.xml to support match_template
opticod Jul 29, 2016
a096916
Added match_template simulator's main fragment layouts
opticod Jul 29, 2016
5cef70c
Added match_template simulator's detail fragment layouts
opticod Jul 29, 2016
d09c19d
Added match_template simulator's list_item_info
opticod Jul 29, 2016
5deb61b
Added match_template simulator's drawables
opticod Jul 30, 2016
3cd3963
Added match_template simulator's adapters
opticod Jul 30, 2016
4f9e7c4
Added match_template simulator's MainFragment
opticod Jul 30, 2016
3e84712
Added match_template simulator's splash fragment
opticod Jul 30, 2016
372e85b
Added match_template simulator's DetailFragment
opticod Jul 30, 2016
3c76f6c
Added match_template simulator's models
opticod Jul 30, 2016
40d58da
Added match_template simulator's database files
opticod Jul 30, 2016
76b20b5
Added match_template simulator's fetch_xml_task + dataUtils + constan…
opticod Jul 30, 2016
85ed1af
Added thumbnails
opticod Aug 2, 2016
20c1d82
Added values + strings + styles + dimens + colors LearnSpellingTemplate
opticod Aug 7, 2016
11e1e23
Added updated LearnSpellingsApp.apk
opticod Aug 7, 2016
efdbfbd
Added drawables + nav_header_main_spell.xml + app_bar_main_spell.xml
opticod Aug 7, 2016
4776f15
Added app_bar_response_spell.xml + content_main_spell.xml + content_r…
opticod Aug 7, 2016
4a81a63
Added fragment_last_spell.xml + fragment_main_spell.xml + fragment_re…
opticod Aug 7, 2016
ff50724
Added nav_header_main_spell.xml + updated spelling_dialog_spellinginp…
opticod Aug 7, 2016
5504b57
Added Databse Utils file for spellingTemplate simulator
opticod Aug 7, 2016
3da9142
Added SplashFragment.java + ResponseFragment.java
opticod Aug 7, 2016
e0e69b2
Added LastFragment.java + MainFragment.java
opticod Aug 7, 2016
b206630
Removed old simulators java files
opticod Aug 7, 2016
879c47a
Updating new simulator path to template
opticod Aug 7, 2016
7450628
Added updated new FlashCardTemplateApp.apk
opticod Aug 9, 2016
dc69bce
Removed old files
opticod Aug 9, 2016
a870e27
Added data files for flash_card_template simulator
opticod Aug 9, 2016
3b19778
Updated values colors+dimens+strings
opticod Aug 9, 2016
35da2c2
Added animations + widgets + constants
opticod Aug 9, 2016
bb36259
Added necessary drawables for flash_template_simulator
opticod Aug 9, 2016
bacd583
Added answer_layout_flash_card.xml + app_bar_main_flash.xml
opticod Aug 9, 2016
5876465
Added content_main_flash.xml + fragment_last_flash.xml
opticod Aug 9, 2016
22640a4
Added remaining layouts for flash_template simulator
opticod Aug 10, 2016
6759957
Added all fragments for flash_simulator + finally attching new design…
opticod Aug 10, 2016
bb37141
Added thumbnail of flash_template
opticod Aug 10, 2016
21570e8
Added updated QuizTemplateApp.apk
opticod Aug 13, 2016
d9ea423
Removed old design of quiz_template
opticod Aug 13, 2016
d3e3427
Made changes in comprehension_simulator design
opticod Aug 13, 2016
5ed2463
Updated dimens + strings for quiz_template
opticod Aug 13, 2016
bcc3e12
Added data files to handle quiz_simulator
opticod Aug 13, 2016
6b130ff
Added all fragments for quiz_template + constants
opticod Aug 13, 2016
1ce09a6
Finally attaching the newly created quizTemplate simulator link
opticod Aug 13, 2016
93d297b
Updated thumbnail of quiz_template
opticod Aug 13, 2016
4a001b2
Next Version is set to 2.0.0 with version code 2 for apk. #54
opticod Aug 15, 2016
d999842
#35, SingleLine Template Name
opticod Aug 15, 2016
805c83f
Added backOnPressed to hide the navigationDrawer
opticod Aug 15, 2016
9a25823
Fixed #14 : Back button not working in Slider Menu.
opticod Aug 19, 2016
a785099
Added #83 : Share Project Feature
opticod Aug 19, 2016
57d0dd2
Changed template editor listView to recyclerView
opticod Aug 20, 2016
3ce6b60
MatchTemplate entries made single line
opticod Aug 21, 2016
210a2fd
Updated MatchTemplate assets apk
opticod Aug 21, 2016
760f521
Making Production Ready + Code CleanUp + Improved Code Quality - 4
opticod Aug 21, 2016
4f5e5e7
Added mobile site address in youtube video info fetching
opticod Aug 21, 2016
75c2e21
Added asynchronous loading of template thumbnail
opticod Aug 22, 2016
7132a74
Added few changes on feedback
opticod Aug 22, 2016
38a6743
Added documentations
opticod Aug 22, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Making Production Ready + Code CleanUp + Improved Code Quality - 4
  • Loading branch information
opticod committed Aug 21, 2016
commit 760f521cbceb082f5dd963a864445f82c39b8e43
1 change: 1 addition & 0 deletions source-code/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity
android:name=".activity.HomeActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

import org.buildmlearn.toolkit.R;

import java.util.Locale;

/**
* @brief Gives brief info about BuildmLearn community and toolkit
*/
Expand All @@ -30,9 +32,10 @@ protected void onCreate(Bundle savedInstanceState) {
pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
String version = pInfo.versionName;
assert findViewById(R.id.app_version) != null;
((TextView)findViewById(R.id.app_version)).setText("Version: " + version);
((TextView) findViewById(R.id.app_version)).setText(String.format(Locale.ENGLISH, "Version: %s", version));
} catch (PackageManager.NameNotFoundException e) {
assert findViewById(R.id.app_version) != null;
assert ((TextView) findViewById(R.id.app_version)) != null;
((TextView)findViewById(R.id.app_version)).setText("Version: 1.0");
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.View;

import org.buildmlearn.toolkit.R;
import org.buildmlearn.toolkit.adapter.TemplateAdapter;
Expand All @@ -27,16 +26,18 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_template);
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
ActionBar actionBar = getSupportActionBar();
assert actionBar != null;
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeButtonEnabled(true);
TemplateAdapter mAdapter = new TemplateAdapter(this);
RecyclerView mRecyclerView = (RecyclerView) findViewById(android.R.id.list);
assert mRecyclerView != null;
mRecyclerView.setAdapter(mAdapter);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));

mAdapter.setOnClickListener(new TemplateAdapter.SetOnClickListener() {
@Override
public void onItemClick(int position, View view) {
public void onItemClick(int position) {
Intent intent = new Intent(getApplicationContext(), TemplateEditor.class);
intent.putExtra(Constants.TEMPLATE_ID, position);
startActivity(intent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,7 @@ private void setUpTemplateEditor() {
populateMetaView(selectedTemplate.newMetaEditorAdapter(this));
}
setUpActionBar();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
} catch (InstantiationException | IllegalAccessException e) {
e.printStackTrace();
}
}
Expand Down Expand Up @@ -409,7 +407,7 @@ public void onClick(DialogInterface dialog, int id) {
return;
}
Uri fileUri = Uri.fromFile(new File(savedFilePath));
ArrayList<Uri> uris = new ArrayList<Uri>();
ArrayList<Uri> uris = new ArrayList<>();
Intent sendIntent = new Intent(Intent.ACTION_SEND_MULTIPLE);
sendIntent.setType("application/zip");
uris.add(fileUri);
Expand All @@ -426,7 +424,7 @@ public void onClick(DialogInterface dialog, int id) {
String keyPassword = getString(R.string.key_password);
String aliasName = getString(R.string.alias_name);
String aliaspassword = getString(R.string.alias_password);
KeyStoreDetails keyStoreDetails = new KeyStoreDetails("TestKeyStore.jks", keyPassword, aliasName, aliaspassword);
KeyStoreDetails keyStoreDetails = new KeyStoreDetails(keyPassword, aliasName, aliaspassword);
SignerThread signer = new SignerThread(getApplicationContext(), selectedTemplate.getApkFilePath(), saveProject(), keyStoreDetails, selectedTemplate.getAssetsFilePath(), selectedTemplate.getAssetsFileName(TemplateEditor.this));

mApkGenerationDialog = new MaterialDialog.Builder(TemplateEditor.this)
Expand Down Expand Up @@ -487,7 +485,7 @@ public void onFail(Exception e) {
keyPassword = getString(R.string.key_password);
aliasName = getString(R.string.alias_name);
aliaspassword = getString(R.string.alias_password);
keyStoreDetails = new KeyStoreDetails("TestKeyStore.jks", keyPassword, aliasName, aliaspassword);
keyStoreDetails = new KeyStoreDetails(keyPassword, aliasName, aliaspassword);
signer = new SignerThread(getApplicationContext(), selectedTemplate.getApkFilePath(), saveProject(), keyStoreDetails, selectedTemplate.getAssetsFilePath(), selectedTemplate.getAssetsFileName(TemplateEditor.this));

mApkGenerationDialog = new MaterialDialog.Builder(TemplateEditor.this)
Expand Down Expand Up @@ -616,8 +614,10 @@ private String saveProject() {
EditText authorEditText = (EditText) findViewById(R.id.author_name);
EditText titleEditText = (EditText) findViewById(R.id.template_title);
assert findViewById(R.id.author_name) != null;
assert ((EditText) findViewById(R.id.author_name)) != null;
String author = ((EditText) findViewById(R.id.author_name)).getText().toString();
assert findViewById(R.id.template_title) != null;
assert ((EditText) findViewById(R.id.template_title)) != null;
String title = ((EditText) findViewById(R.id.template_title)).getText().toString();
if ("".equals(author)) {
assert authorEditText != null;
Expand Down Expand Up @@ -695,9 +695,11 @@ public void onBackPressed() {
* @return Absolute path of the saved file. Null if there is some error.
* @brief Saves the current project into a .buildmlearn file.
*/
protected String saveDraft() {
private String saveDraft() {

assert ((EditText) findViewById(R.id.author_name)) != null;
String author = ((EditText) findViewById(R.id.author_name)).getText().toString();
assert ((EditText) findViewById(R.id.template_title)) != null;
String title = ((EditText) findViewById(R.id.template_title)).getText().toString();


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ protected void onCreate(Bundle savedInstanceState) {
ViewPager mPager = (ViewPager) findViewById(R.id.pager);
// mPager.setAdapter(mAdapter);

assert mPager != null;
mPager.setAdapter(mAdapter);


CirclePageIndicator mIndicator = (CirclePageIndicator) findViewById(R.id.indicator);
assert mIndicator != null;
mIndicator.setViewPager(mPager);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
import org.buildmlearn.toolkit.views.TextViewPlus;

import java.util.ArrayList;
import java.util.Locale;

/**
* Created by scopeinfinity on 10/3/16.
*/
public class DraftProjectAdapter extends BaseAdapter {

private Context mContext;
private ArrayList<SavedProject> data;
private final Context mContext;
private final ArrayList<SavedProject> data;

public DraftProjectAdapter(Context mContext, ArrayList<SavedProject> data) {
this.mContext = mContext;
Expand Down Expand Up @@ -68,8 +69,8 @@ public View getView(int position, View convertView, ViewGroup parent) {
}

SavedProject projectData = getItem(position);
holder.draftSubtitle.setText("Last Modified: " + projectData.getTime() );
holder.draftTitle.setText("Drafted on "+projectData.getDate());
holder.draftSubtitle.setText(String.format(Locale.ENGLISH, "Last Modified: %s", projectData.getTime()));
holder.draftTitle.setText(String.format(Locale.ENGLISH, "Drafted on %s", projectData.getDate()));
holder.draftIcon.setText("D");
convertView.setTag(holder);
return convertView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

public class SavedApiAdapter extends BaseAdapter {

private Context mContext;
private ArrayList<SavedApi> data;
private final Context mContext;
private final ArrayList<SavedApi> data;

public SavedApiAdapter(Context mContext, ArrayList<SavedApi> data) {
this.mContext = mContext;
Expand Down Expand Up @@ -72,7 +72,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
}

SavedApi apiData = getItem(position);
holder.details.setText("Modified: " + apiData.getDate() + ", Author: " + apiData.getAuthor());
holder.details.setText(String.format(Locale.ENGLISH, "Modified: %s, Author: ", apiData.getDate(), apiData.getAuthor()));
holder.apkName.setText(apiData.getName());
holder.projectIcon.setText(apiData.getName().substring(0, 1).toUpperCase(Locale.US));
convertView.setTag(holder);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.buildmlearn.toolkit.adapter;

import android.content.Context;
import android.support.v4.content.ContextCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -81,13 +82,13 @@ public View getView(int position, View convertView, ViewGroup parent) {
}

if (selectedPosition == position) {
convertView.setBackgroundColor(mContext.getResources().getColor(R.color.color_divider));
convertView.setBackgroundColor(ContextCompat.getColor(mContext, R.color.color_divider));
} else {
convertView.setBackgroundColor(0);
}

SavedProject projectData = getItem(position);
holder.details.setText("Modified: " + projectData.getDate() + ", Author: " + projectData.getAuthor());
holder.details.setText(String.format(Locale.ENGLISH, "Modified: %s, Author: ", projectData.getDate(), projectData.getAuthor()));
holder.projectName.setText(projectData.getName());
holder.projectIcon.setText(projectData.getName().substring(0, 1).toUpperCase(Locale.US));
convertView.setTag(holder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int posit
}

View view = inflater.inflate(layoutResource, viewGroup, false);
RecyclerView.ViewHolder viewHolder = new ViewHolder(view);

return viewHolder;
return new ViewHolder(view);
}

public Template getItem(int i) {
private Template getItem(int i) {
return templates[i];
}

Expand Down Expand Up @@ -119,14 +118,14 @@ public int getColor() {
}

public interface SetOnClickListener extends ViewHolder.SetOnClickListener {
void onItemClick(int position, View itemView);
void onItemClick(int position);
}

public static class ViewHolder extends RecyclerView.ViewHolder {
public TextView title;
public TextView description;
public ImageView image;
public CardView cardView;
public final TextView title;
public final TextView description;
public final ImageView image;
public final CardView cardView;
SetOnClickListener listener;

public ViewHolder(final View v) {
Expand All @@ -141,7 +140,7 @@ public ViewHolder(final View v) {
@Override
public void onClick(View view) {
if (listener != null) {
listener.onItemClick(getAdapterPosition(), v);
listener.onItemClick(getAdapterPosition());
}
}
});
Expand All @@ -151,40 +150,24 @@ public ImageView getImage() {
return image;
}

public void setImage(ImageView image) {
this.image = image;
}

public CardView getCardView() {
return cardView;
}

public void setCardView(CardView cardView) {
this.cardView = cardView;
}

public TextView getDescription() {
return description;
}

public void setDescription(TextView description) {
this.description = description;
}

public TextView getTitle() {
return title;
}

public void setTitle(TextView title) {
this.title = title;
}

public void setItemClickListener(SetOnClickListener itemClickListener) {
this.listener = itemClickListener;
}

public interface SetOnClickListener {
void onItemClick(int position, View itemView);
void onItemClick(int position);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ private Tutorial getItem(int position) {
return mTutorials[position];
}

public long getItemId(int position) {
return position;
}

/**
* {@inheritDoc}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ public void open() throws SQLException {
db = dbHelper.getWritableDatabase();
}

public boolean isOpen() {
return db.isOpen();
}

public void close() {
dbHelper.close();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.buildmlearn.toolkit.comprehensiontemplate.data;

import android.content.Context;

import org.buildmlearn.toolkit.comprehensiontemplate.Constants;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
Expand All @@ -18,7 +16,7 @@
*/
public class DataUtils {

public static String[] readTitleAuthor(Context myContext) {
public static String[] readTitleAuthor() {
String result[] = new String[2];
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public boolean onMenuItemClick(MenuItem menuItem) {
welcomeAlert.show();
assert welcomeAlert.findViewById(android.R.id.message) != null;
assert welcomeAlert.findViewById(android.R.id.message) != null;
assert ((TextView) welcomeAlert.findViewById(android.R.id.message)) != null;
((TextView) welcomeAlert.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());
break;
default: //do nothing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public boolean onMenuItemClick(MenuItem menuItem) {
welcomeAlert.show();
assert welcomeAlert.findViewById(android.R.id.message) != null;
assert welcomeAlert.findViewById(android.R.id.message) != null;
assert ((TextView) welcomeAlert.findViewById(android.R.id.message)) != null;
((TextView) welcomeAlert.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());
break;
default: //do nothing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public boolean onMenuItemClick(MenuItem menuItem) {
welcomeAlert.show();
assert welcomeAlert.findViewById(android.R.id.message) != null;
assert welcomeAlert.findViewById(android.R.id.message) != null;
assert ((TextView) welcomeAlert.findViewById(android.R.id.message)) != null;
((TextView) welcomeAlert.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());
break;
default: //do nothing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
View rootView = inflater.inflate(R.layout.fragment_splash, container, false);

final Activity mActivity = getActivity();
final String result[] = DataUtils.readTitleAuthor(getContext());
final String result[] = DataUtils.readTitleAuthor();
TextView title = (TextView) rootView.findViewById(R.id.title);
TextView author_name = (TextView) rootView.findViewById(R.id.author_name);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import org.xml.sax.SAXException;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;

import javax.xml.parsers.DocumentBuilder;
Expand Down Expand Up @@ -37,9 +36,7 @@ public static String[] readTitleAuthor() {
result[1] = doc.getElementsByTagName("name").item(0).getChildNodes()
.item(0).getNodeValue();

} catch (ParserConfigurationException | FileNotFoundException | SAXException e) {
e.printStackTrace();
} catch (IOException e) {
} catch (ParserConfigurationException | SAXException | IOException e) {
e.printStackTrace();
}
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ public void open() throws SQLException {
db = dbHelper.getWritableDatabase();
}

public boolean isOpen() {
return db.isOpen();
}

public void close() {
dbHelper.close();
}
Expand Down
Loading