Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update master branch after completion of GSoC EndTerm 2016 #151

Merged
merged 85 commits into from
Aug 22, 2016
Merged
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
Changed template editor listView to recyclerView
  • Loading branch information
opticod committed Aug 20, 2016
commit 57d0dd2b4b735b8a60c8cfc59d8d3b5dfc946a86
Original file line number Diff line number Diff line change
@@ -4,11 +4,10 @@
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.ListAdapter;

import org.buildmlearn.toolkit.R;
import org.buildmlearn.toolkit.adapter.TemplateAdapter;
@@ -30,18 +29,17 @@ protected void onCreate(Bundle savedInstanceState) {
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeButtonEnabled(true);
ListAdapter mAdapter = new TemplateAdapter(this);
AbsListView mListView = (AbsListView) findViewById(android.R.id.list);
mListView.setAdapter(mAdapter);
TemplateAdapter mAdapter = new TemplateAdapter(this);
RecyclerView mRecyclerView = (RecyclerView) findViewById(android.R.id.list);
mRecyclerView.setAdapter(mAdapter);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));

mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
mAdapter.setOnClickListener(new TemplateAdapter.SetOnClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

public void onItemClick(int position, View view) {
Intent intent = new Intent(getApplicationContext(), TemplateEditor.class);
intent.putExtra(Constants.TEMPLATE_ID, position);
startActivity(intent);

}
});
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package org.buildmlearn.toolkit.adapter;

import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.support.annotation.ColorRes;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

@@ -16,36 +17,70 @@

/**
* @brief Adapter used for showing Templates available in the toolkit
*
* <p>
* Created by Abhishek on 23-05-2015.
*/
public class TemplateAdapter extends BaseAdapter {
public class TemplateAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

private final Context context;

private final Template[] templates = Template.values();
private final ListColor[] colors = ListColor.values();
private ViewHolder.SetOnClickListener listener;

public TemplateAdapter(Context context) {
this.context = context;
}

/**
* {@inheritDoc}
*/
@Override
public int getCount() {
return templates.length;
public void setOnClickListener(ViewHolder.SetOnClickListener clickListener) {
this.listener = clickListener;
}

/**
* {@inheritDoc}
*/
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int position) {
int layoutResource = 0;
LayoutInflater inflater = ((Activity) context).getLayoutInflater();
int viewType = getItemViewType(position);
switch (viewType) {
case 0:
layoutResource = R.layout.item_template_right;
break;
case 1:
layoutResource = R.layout.item_template_left;
break;
}

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

return viewHolder;
}

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

@Override
public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) {

ViewHolder vh = (ViewHolder) viewHolder;
Template template = getItem(position);

vh.getTitle().setText(template.getTitle());
vh.getDescription().setText(template.getDescription());
vh.getImage().setImageResource(template.getImage());

int color = colors[position % colors.length].getColor();
vh.getCardView().setCardBackgroundColor(color);
vh.setItemClickListener(listener);

}

@Override
public int getItemCount() {
return templates.length;
}

/**
* {@inheritDoc}
*/
@@ -54,34 +89,12 @@ public long getItemId(int i) {
return i;
}

/**
* {@inheritDoc}
*/
@Override
public View getView(int i, View view, ViewGroup viewGroup) {

LayoutInflater mInflater;
mInflater = LayoutInflater.from(context);

if (i % 2 == 0) {
view = mInflater.inflate(R.layout.item_template_right, viewGroup, false);
} else {
view = mInflater.inflate(R.layout.item_template_left, viewGroup, false);
}

Template template = getItem(i);

((TextView) view.findViewById(R.id.title)).setText(template.getTitle());
((TextView) view.findViewById(R.id.description)).setText(template.getDescription());
((ImageView) view.findViewById(R.id.image)).setImageResource(template.getImage());

int color = colors[i % colors.length].getColor();
((CardView) view.findViewById(R.id.card_view)).setCardBackgroundColor(color);

return view;
public int getItemViewType(int position) {
return position % 2;
}

private enum ListColor {
enum ListColor {
BLUE("#29A6D4"),
GREEN("#1C7D6C"),
ORANGE("#F77400"),
@@ -104,4 +117,74 @@ public int getColor() {
return color;
}
}

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

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

public ViewHolder(final View v) {
super(v);
title = ((TextView) v.findViewById(R.id.title));
description = ((TextView) v.findViewById(R.id.description));
image = ((ImageView) v.findViewById(R.id.image));
cardView = ((CardView) v.findViewById(R.id.card_view));

v.setClickable(true);
v.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (listener != null) {
listener.onItemClick(getAdapterPosition(), v);
}
}
});
}

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);
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@

<include layout="@layout/toolbar_layout" />

<ListView
<android.support.v7.widget.RecyclerView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
1 change: 1 addition & 0 deletions source-code/app/src/main/res/layout/item_template_left.xml
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/layout_margin"
android:foreground="?attr/selectableItemBackground"
android:minHeight="@dimen/cardview_template_height"
card_view:cardCornerRadius="@dimen/cardview_default_radius"
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/layout_margin"
android:foreground="?attr/selectableItemBackground"
android:minHeight="@dimen/cardview_template_height"
card_view:cardCornerRadius="@dimen/cardview_default_radius"
3 changes: 1 addition & 2 deletions source-code/app/src/main/res/values-large/refs.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<resources>

<item name="activity_template" type="layout">@layout/activity_template_grid</item>
<item name="activity_template" type="layout">@layout/activity_template_list</item>
<item name="fragment_loadproject" type="layout">@layout/fragment_loadproject_grid</item>

</resources>
2 changes: 1 addition & 1 deletion source-code/app/src/main/res/values-sw600dp/refs.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources>

<item name="activity_template" type="layout">@layout/activity_template_grid</item>
<item name="activity_template" type="layout">@layout/activity_template_list</item>
<item name="fragment_loadproject" type="layout">@layout/fragment_loadproject_grid</item>

</resources>