Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .idea/markdown-navigator/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import android.content.Context;
import android.graphics.Paint;
import android.graphics.Typeface;
import android.os.Build;
import android.support.annotation.RequiresApi;
import android.support.v4.util.LruCache;
import android.text.Spannable;
import android.text.SpannableString;
Expand All @@ -31,6 +33,7 @@ public class FontsOverride {

public static final String FONT_PROXIMA_NOVA = "ProximaNova.ttf";

@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public static void applyFontForToolbarTitle(Activity act, String fontName, Window window){

ActionBar ab = act.getActionBar();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.codingblocks.attendancetracker;

import android.content.Intent;
import android.os.Build;
import android.support.annotation.RequiresApi;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
Expand All @@ -25,6 +27,7 @@ public class ListOfAbsentPresentStudentsActivity extends AppCompatActivity {
private PresentAdapter presentAdapter;
private AbsentAdapter absentAdapter;

@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.RequiresApi;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
Expand All @@ -14,6 +16,7 @@
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

Expand All @@ -35,7 +38,7 @@ public class MainActivity extends AppCompatActivity {
private String selectedBatch;
private MyAdapter myAdapter;

private LinearLayout background;
private RelativeLayout background;

private ArrayList<Student> students;

Expand All @@ -52,6 +55,7 @@ public void run() {
}
};

@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -70,7 +74,7 @@ protected void onCreate(Bundle savedInstanceState) {

private void initViews() {
cardStack = (SwipeDeck) findViewById(R.id.swipe_deck);
background = (LinearLayout) findViewById(R.id.activity_main);
background = (RelativeLayout) findViewById(R.id.activity_main);
spinner = (CustomSpinner) findViewById(R.id.spinner_batch);
coursebutton = (FloatingActionButton) findViewById(R.id.create_course_button);
coursebutton.setOnClickListener(new View.OnClickListener() {
Expand Down Expand Up @@ -123,6 +127,7 @@ private void setupEventListener() {
cardStack.setEventCallback(new SwipeDeck.SwipeEventCallback() {
@Override
public void cardSwipedLeft(int position) {
//Absent
background.setBackgroundColor(Color.RED);
handler.postDelayed(run, 200);
absentIds.add(students.get(position).getUniqueId());
Expand All @@ -131,7 +136,7 @@ public void cardSwipedLeft(int position) {

@Override
public void cardSwipedRight(int position) {
//present
//Present
background.setBackgroundColor(Color.GREEN);
handler.postDelayed(run, 200);
presentIds.add(students.get(position).getUniqueId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ public static ArrayList<String> getDummyBatches() {
batches.add("Crux");
batches.add("Pandora");
batches.add("Launchpad");

batches.add("Elixir");

batches.add("Django");

return batches;

}
Expand Down
68 changes: 68 additions & 0 deletions app/src/main/res/layout-land/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"

android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.codingblocks.attendancetracker.MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="@string/swipe_left_present_right_absent"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Title" />

<RelativeLayout
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<com.piotrek.customspinner.CustomSpinner
android:id="@+id/spinner_batch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>

</RelativeLayout>

<com.daprlabs.cardstack.SwipeFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:swipedeck="http://schemas.android.com/apk/res-auto"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_centerInParent="true"
android:orientation="vertical">

<com.daprlabs.cardstack.SwipeDeck
android:id="@+id/swipe_deck"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="20dp"
swipedeck:card_gravity="top"
swipedeck:card_spacing="10dp"
swipedeck:max_visible="3"
swipedeck:render_above="true"
swipedeck:rotation_degrees="10" />

</com.daprlabs.cardstack.SwipeFrameLayout>

<android.support.design.widget.FloatingActionButton
android:id="@+id/create_course_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_margin="10dp"
android:src="@drawable/ic_add"
app:fabSize="normal" />

</RelativeLayout>
18 changes: 11 additions & 7 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
Expand All @@ -14,13 +14,15 @@
tools:context="com.codingblocks.attendancetracker.MainActivity">

<TextView
android:id="@+id/onetx"
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/swipe_left_present_right_absent"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Title" />

<LinearLayout
<RelativeLayout
android:layout_below="@id/onetx"
android:layout_width="match_parent"
android:layout_height="wrap_content">

Expand All @@ -30,20 +32,20 @@
android:layout_height="wrap_content"
android:layout_marginTop="20dp" />

</LinearLayout>
</RelativeLayout>

<com.daprlabs.cardstack.SwipeFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:swipedeck="http://schemas.android.com/apk/res-auto"
android:layout_width="300dp"
android:layout_height="300dp"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:orientation="vertical">

<com.daprlabs.cardstack.SwipeDeck
android:id="@+id/swipe_deck"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="20dp"
swipedeck:card_gravity="top"
swipedeck:card_spacing="10dp"
Expand All @@ -57,8 +59,10 @@
android:id="@+id/create_course_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_margin="16dp"
android:src="@drawable/ic_add"
app:fabSize="normal" />

</LinearLayout>
</RelativeLayout>
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.android.tools.build:gradle:2.3.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down