Skip to content

Commit

Permalink
hardcoded video demo version
Browse files Browse the repository at this point in the history
  • Loading branch information
Deren Vural committed May 4, 2020
1 parent fd76cf8 commit 5b9cf57
Show file tree
Hide file tree
Showing 21 changed files with 6,075 additions and 313 deletions.
2 changes: 0 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,4 @@ dependencies {
implementation 'com.google.firebase:firebase-storage:19.1.1'
// Volley
implementation 'com.android.volley:volley:1.1.1'
// ui4j webkit
implementation files('libs/ui4j-webkit-4.0.0.jar')
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import derenvural.sourceread_prototype.R;
import derenvural.sourceread_prototype.SourceReadActivity;

public class CardAdapter<T> extends RecyclerView.Adapter<CardAdapter.CardViewHolder> {
public abstract class CardAdapter<T> extends RecyclerView.Adapter<CardAdapter.CardViewHolder> {
protected ArrayList<T> mDataHolders;
protected static Context context;
protected static View.OnClickListener listener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ public class AppAdapter extends CardAdapter<App> {
// Complex data items may need more than one view per item, and
// you provide access to all the views for a data item in a view holder
public static class AppViewHolder extends CardViewHolder {
// data items
public ImageView vImage;
public TextView vTitle;
public TextView vText;
public AppViewHolder(View v) {
super(v);
// Create view references
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ public class ArticleAdapter extends CardAdapter<Article> {
// Complex data items may need more than one view per item, and
// you provide access to all the views for a data item in a view holder
public static class ArticleViewHolder extends CardViewHolder {
// data items
public ImageView vImage;
public TextView vTitle;
public TextView vText;
public ArticleViewHolder(View v) {
super(v);
// Create view references
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
package derenvural.sourceread_prototype.data.functions;

import android.graphics.drawable.Drawable;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

public abstract class Function implements FunctionHolder {
private String title;
private String text;
private CharSequence title;
private CharSequence text;
private Integer image;

// extended functionality eg onclick, links, analysis data
public Function(@NonNull String newTitle, @Nullable String newText){
public Function(@NonNull CharSequence newTitle, @Nullable CharSequence newText, @Nullable Integer newImage){
setTitle(newTitle);
setText(newText);
setImage(newImage);
}

// GET
public String getTitle(){
public CharSequence getTitle(){
return title;
}
public String getText(){
public CharSequence getText(){
return text;
}
public Integer getImage() { return image; }

// SET
public void setTitle(String title){ this.title = title; }
public void setText(String text){
public void setTitle(CharSequence title){ this.title = title; }
public void setText(CharSequence text){
this.text = text;
}
public void setImage(Integer image) { this.image = image; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;
Expand All @@ -15,9 +16,9 @@
import derenvural.sourceread_prototype.R;
import derenvural.sourceread_prototype.SourceReadActivity;

public class FunctionAdapter<T> extends RecyclerView.Adapter<FunctionAdapter.FunctionViewHolder> {
public abstract class FunctionAdapter<T> extends RecyclerView.Adapter<FunctionAdapter.FunctionViewHolder> {
protected ArrayList<T> mDataHolders;
protected static Context context;
protected Context context;
protected static View.OnClickListener listener;

// Provide a reference to the views for each data item
Expand All @@ -26,23 +27,17 @@ public class FunctionAdapter<T> extends RecyclerView.Adapter<FunctionAdapter.Fun
public static class FunctionViewHolder extends RecyclerView.ViewHolder {
// data items
public TextView vTitle;
public EditText vInput;
public FunctionViewHolder(View v) {
super(v);
// Create view references
vTitle = v.findViewById(R.id.search_bar_title);
vInput = v.findViewById(R.id.search_bar_text);

// Add click listener for fragment transition
//v.setOnClickListener(listener);
}
}

// Provide a suitable constructor (depends on the kind of dataset)
public FunctionAdapter(SourceReadActivity context, ArrayList<T> newCards/*, View.OnClickListener listener*/) {
public FunctionAdapter(SourceReadActivity context, ArrayList<T> newCards) {
this.context = context;
this.mDataHolders = newCards;
//FunctionAdapter.listener = listener;
}

// Create new views (invoked by the layout manager)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ public interface FunctionHolder {
// Methods

// GET
String getTitle();
String getText();
Integer getImage();
CharSequence getTitle();
CharSequence getText();

// SET
void setTitle(String title);
void setText(String text);
void setImage(Integer title);
void setTitle(CharSequence title);
void setText(CharSequence text);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package derenvural.sourceread_prototype.data.functions.graph;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import derenvural.sourceread_prototype.data.functions.Function;

public class Graph extends Function {
// Constructors
public Graph(@NonNull CharSequence title, @Nullable CharSequence text, @Nullable Integer imageID) {
super(title, text, imageID);
}
}
Loading

0 comments on commit 5b9cf57

Please sign in to comment.