...
 
Commits (2)
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="WizardSettings">
<option name="children">
<map>
<entry key="imageWizard">
<value>
<PersistentState>
<option name="children">
<map>
<entry key="imageAssetPanel">
<value>
<PersistentState>
<option name="children">
<map>
<entry key="actionbar">
<value>
<PersistentState>
<option name="children">
<map>
<entry key="clipartAsset">
<value>
<PersistentState>
<option name="values">
<map>
<entry key="url" value="jar:file:/C:/Program%20Files/Android/Android%20Studio/plugins/android/lib/android.jar!/images/material_design_icons/action/ic_event_black_24dp.xml" />
</map>
</option>
</PersistentState>
</value>
</entry>
</map>
</option>
<option name="values">
<map>
<entry key="outputName" value="ic_action_cal" />
</map>
</option>
</PersistentState>
</value>
</entry>
</map>
</option>
<option name="values">
<map>
<entry key="outputIconType" value="ACTIONBAR" />
</map>
</option>
</PersistentState>
</value>
</entry>
</map>
</option>
</PersistentState>
</value>
</entry>
</map>
</option>
</component>
</project>
\ No newline at end of file
......@@ -25,7 +25,7 @@
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
......@@ -28,6 +28,7 @@ dependencies {
implementation project(":qi-data")
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:27.1.1'
testImplementation "junit:junit:$rootProject.ext.junitVersion"
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
......@@ -40,18 +41,19 @@ dependencies {
//picasso
implementation "com.squareup.picasso:picasso:$rootProject.ext.picassoVersion"
//calendar
implementation 'com.riontech:calendar:1.0'
//gson
implementation "com.google.code.gson:gson:$rootProject.ext.gsonVersion"
//retrofit
implementation "com.squareup.retrofit2:retrofit:$rootProject.ext.retrofitVersion"
implementation "com.squareup.retrofit2:converter-gson:$rootProject.ext.retrofitVersion"
//dependency injection
//implementation "com.google.dagger:dagger:$rootProject.ext.daggerVersion"
// apt 'com.google.dagger:dagger-compiler:2.8'
annotationProcessor "com.google.dagger:dagger-compiler:$rootProject.ext.daggerVersion"
implementation "com.google.dagger:dagger:$rootProject.ext.daggerVersion"
//circle img
implementation 'de.hdodenhof:circleimageview:1.2.2'
//rx
implementation "io.reactivex.rxjava2:rxjava:$rootProject.ext.rxjavaVersion"
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
......
......@@ -16,6 +16,9 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ui.profile.ProfileActivity" />
<activity android:name=".ui.events.EventsActivity" />
<activity android:name=".ui.courses.CourseActivity"></activity>
</application>
</manifest>
\ No newline at end of file
package com.flimbis.qi;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
public class MainActivity extends AppCompatActivity {
import com.flimbis.qi.ui.events.EventsActivity;
import com.flimbis.qi.ui.home.MainPresenter;
import com.flimbis.qi.ui.home.ViewContract;
import com.flimbis.qi.ui.profile.ProfileActivity;
import de.hdodenhof.circleimageview.CircleImageView;
public class MainActivity extends AppCompatActivity implements ViewContract.View {
private Toolbar toolbar;
private CircleImageView profileImage;
private RecyclerView recyclerView;
MainPresenter presenter;
@Override
protected void onCreate(Bundle savedInstanceState) {
setTheme(R.style.AppTheme_Def);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initViews();
setSupportActionBar(toolbar);
getSupportActionBar().setTitle("");
}
@Override
protected void onResume() {
super.onResume();
/* profileImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
presenter.navigateToProfile();
}
});*/
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_cal:
Intent intent = new Intent(this, EventsActivity.class);
startActivity(intent);
overridePendingTransition(R.anim.slide_from_right /*enterAnimationId*/, R.anim.slide_to_left/*exitAnimationId*/);
// presenter.navigateToEvents();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
@Override
public void showDashboard() {
}
@Override
public void showProfile() {
Intent intent = new Intent(this, ProfileActivity.class);
startActivity(intent);
overridePendingTransition(R.anim.slide_from_right /*enterAnimationId*/, R.anim.slide_to_left/*exitAnimationId*/);
}
@Override
public void showEvents() {
Intent intent = new Intent(this, EventsActivity.class);
startActivity(intent);
overridePendingTransition(R.anim.slide_from_right /*enterAnimationId*/, R.anim.slide_to_left/*exitAnimationId*/);
}
@Override
public boolean isLogin() {
return false;
}
@Override
public boolean isNetworkAvailable() {
return false;
}
@Override
public void showMessage(String msg, String type) {
}
private void initViews() {
toolbar = (Toolbar) findViewById(R.id.toolbar);
profileImage = findViewById(R.id.img_prof);
recyclerView = findViewById(R.id.recy_main);
}
}
package com.flimbis.qi.adapter;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.flimbis.qi.R;
import de.hdodenhof.circleimageview.CircleImageView;
public class AgendaStreakAdapter extends RecyclerView.Adapter<AgendaStreakAdapter.ViewHolder>{
private Context context;
public AgendaStreakAdapter(Context context) {
this.context = context;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.items_agenda,parent,false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
}
@Override
public int getItemCount() {
return 0;
}
public class ViewHolder extends RecyclerView.ViewHolder {
private CircleImageView alert;
private TextView day;
public ViewHolder(View itemView) {
super(itemView);
day = itemView.findViewById(R.id.txt_agenda_day);
alert = itemView.findViewById(R.id.img_agenda_alert);
}
}
}
package com.flimbis.qi.adapter;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.flimbis.qi.R;
public class HomeAdapter extends RecyclerView.Adapter<HomeAdapter.ViewHolder>{
private Context context;
private final int AGENDA = 0;
private final int COURSE = 1;
private final int TODO_TASK = 2;
public HomeAdapter(Context context) {
this.context = context;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return null;
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
}
@Override
public int getItemCount() {
return 0;
}
public class ViewHolder extends RecyclerView.ViewHolder{
private TextView title;
private TextView date;
public ViewHolder(View itemView) {
super(itemView);
title = itemView.findViewById(R.id.txt_main_title);
date = itemView.findViewById(R.id.txt_main_date);
}
}
}
package com.flimbis.qi.adapter;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import java.util.ArrayList;
import java.util.List;
public class ProfileTabAdapter extends FragmentStatePagerAdapter {
private final List<Fragment> fragmentList = new ArrayList<>();
private final List<String> fragmentTitleList = new ArrayList<>();
public ProfileTabAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
return fragmentList.get(position);
}
@Override
public int getCount() {
return fragmentList.size();
}
@Nullable
@Override
public CharSequence getPageTitle(int position) {
return fragmentTitleList.get(position);
}
public void addFragment(Fragment fragment, String title) {
fragmentList.add(fragment);
fragmentTitleList.add(title);
}
}
package com.flimbis.qi.model;
public class EventModel {
}
package com.flimbis.qi.ui.courses;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.flimbis.qi.R;
/**
* A simple {@link Fragment} subclass.
*/
public class ChatFragment extends Fragment {
public ChatFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_chat, container, false);
}
}
package com.flimbis.qi.ui.courses;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.flimbis.qi.R;
public class CourseActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_course);
}
}
package com.flimbis.qi.ui.courses;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.flimbis.qi.R;
/**
* A simple {@link Fragment} subclass.
*/
public class CourseFragment extends Fragment {
public CourseFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_course, container, false);
}
}
package com.flimbis.qi.ui.events;
import android.app.PendingIntent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.flimbis.qi.R;
import com.riontech.calendar.CustomCalendar;
public class EventsActivity extends AppCompatActivity {
private CustomCalendar customCalendar;
@Override
protected void onCreate(Bundle savedInstanceState) {
setTheme(R.style.AppTheme_Def);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_events);
customCalendar = (CustomCalendar) findViewById(R.id.customCalendar);
String[] arr = {"2016-06-10", "2016-06-11", "2016-06-15", "2016-06-16", "2016-06-25"};
for (int i = 0; i < 5; i++) {
int eventCount = 3;
//customCalendar.addAnEvent(arr[i], eventCount, getEventDataList(eventCount));
}
}
@Override
public void finish() {
super.finish();
overridePendingTransition(R.anim.slide_from_left, R.anim.slide_to_right);
}
}
package com.flimbis.qi.ui.events;
public interface EventsViewContract {
interface View {
void showMessage(String msg, String type);
}
interface Presenter {
void unbind();
}
}
package com.flimbis.qi.ui.home;
import javax.inject.Inject;
public class MainPresenter implements ViewContract.Presenter {
private ViewContract.View view;
@Inject
public MainPresenter(ViewContract.View view) {
this.view = view;
}
@Override
public void load() {
}
@Override
public void navigateToProfile() {
view.showProfile();
}
@Override
public void navigateToEvents() {
view.showEvents();
}
@Override
public void unBind() {
view = null;
//usecase.dispose();
}
}
package com.flimbis.qi.ui.home;
public interface ViewContract {
interface View {
void showDashboard();
void showProfile();
void showEvents();
boolean isLogin();
boolean isNetworkAvailable();
void showMessage(String msg, String type);
}
interface Presenter {
void load();
void navigateToProfile();
void navigateToEvents();
void unBind();
}
}
package com.flimbis.qi.ui.profile;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.flimbis.qi.R;
import com.flimbis.qi.adapter.ProfileTabAdapter;
import com.flimbis.qi.ui.courses.ChatFragment;
import com.flimbis.qi.ui.courses.CourseFragment;
public class ProfileActivity extends AppCompatActivity {
private ProfileTabAdapter adapter;
private TabLayout tabLayout;
private ViewPager viewPager;
public ProfileActivity() {
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_profile);
viewPager = (ViewPager) findViewById(R.id.viewPager);
tabLayout = (TabLayout) findViewById(R.id.tabLayout);
adapter = new ProfileTabAdapter(getSupportFragmentManager());
adapter.addFragment(new CourseFragment(), "Tab 1");
adapter.addFragment(new ChatFragment(), "Tab 2");
viewPager.setAdapter(adapter);
tabLayout.setupWithViewPager(viewPager);
}
@Override
public void finish() {
super.finish();
overridePendingTransition(R.anim.slide_from_left, R.anim.slide_to_right);
}
}
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="-100%p" android:toXDelta="0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:duration="@integer/slide_animation_duration"/>
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="100%p" android:toXDelta="0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:duration="@integer/slide_animation_duration"/>
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="0" android:toXDelta="-100%p"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:duration="@integer/slide_animation_duration"/>
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="0" android:toXDelta="100%p"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:duration="@integer/slide_animation_duration"/>
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.courses.CourseActivity">
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
<?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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.events.EventsActivity">
<com.riontech.calendar.CustomCalendar
android:id="@+id/customCalendar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:endMonth="07"
app:endYear="2016"
app:startMonth="01"
app:startYear="2016" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<include
android:id="@+id/toolbar"
layout="@layout/app_bar" />
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
<android.support.v7.widget.RecyclerView
android:id="@+id/recy_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/toolbar" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="@+id/toolbar_prof"
layout="@layout/app_bar" />
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?actionBarSize"
app:tabBackground="?themePrimary"
app:tabGravity="fill"
app:tabIndicatorColor="?themeTextColorSecondary"
app:tabIndicatorHeight="4dp"
app:tabMode="fixed"></android.support.design.widget.TabLayout>
<android.support.v4.view.ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"></android.support.v4.view.ViewPager>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:elevation="1dp"
android:theme="@style/CustomToolbar"
app:popupTheme="@style/ThemeOverlay.MyTheme">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/img_prof"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_action_account"
android:layout_centerVertical="true"
android:layout_gravity="left|end"
android:layout_marginRight="16dp" />
</android.support.v7.widget.Toolbar>
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.courses.ChatFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
</FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.courses.CourseFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
</FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/txt_agenda_day"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/img_agenda_alert"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:background="#ff3300"
/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_devotion"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
app:cardBackgroundColor="?themeCardBackground"
app:cardCornerRadius="5dp"
app:cardElevation="1dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/img_main_icon"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginRight="5dp" />
<LinearLayout
android:id="@+id/lnr_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/img_main_icon"
android:orientation="vertical">
<TextView
android:id="@+id/txt_main_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/txt_main_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<ImageView
android:id="@+id/img_main_arrow"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignParentRight="true" />
</RelativeLayout>
</android.support.v7.widget.CardView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="56dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Agenda"/>
</RelativeLayout>
<View
android:layout_width="1dp"
android:layout_height="0dp"
android:background="#ff3300"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/recy_agenda"
android:layout_width="wrap_content"
android:layout_height="56dp"/>
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/menu_cal"
android:title="@string/menu_cal"
android:icon="?themeMenuCal"
app:showAsAction="always"></item>
</menu>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="BaseTheme">
<!-- Customize your theme here. -->
<item name="android:windowContentTransitions">true</item>
</style>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<attr name="themePrimary" format="reference"/>
<attr name="themePrimaryDark" format="reference"/>
<attr name="themeAccent" format="reference"/>
<attr name="themeBackground" format="reference"/>
<attr name="themeTextColor" format="reference" />
<attr name="themeTextColorSecondary" format="reference" />
<attr name="themeTextColorDull" format="reference" />
<attr name="themeCardBackground" format="reference"/>
<attr name="themeMenuCal" format="reference"/>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<!--default-->
<color name="defaultPrimary">#4682B4</color>
<color name="defaultPrimaryDark">#286090</color>
<color name="defaultAccent">#FF3300</color>
<color name="defaultText">#6b6767</color>
<color name="defaultTextSecondary">#ffffff</color>
<color name="defaultDull">#616161</color>
<color name="background_holo_light">#fff3f3f3</color>
<color name="dove">#f0f0f0</color>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer name="slide_animation_duration">400</integer>
</resources>
\ No newline at end of file
<resources>
<string name="app_name">Qi</string>
<string name="menu_cal">events</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
</resources>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="BaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">?themePrimary</item>
<item name="colorPrimaryDark">?themePrimaryDark</item>
<item name="colorAccent">?themeAccent</item>
<item name="android:textColorPrimary">?themeTextColor</item>
<item name="android:textColorSecondary">?themeTextColorSecondary</item>
<item name="android:windowBackground">?themeBackground</item>
<item name="android:itemBackground">#f0f0f0</item>
</style>
<style name="AppTheme" parent="BaseTheme">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<!--default theme-->
<style name="AppTheme.Def">
<item name="themePrimary">@color/defaultPrimary</item>
<item name="themePrimaryDark">@color/defaultPrimaryDark</item>
<item name="themeAccent">@color/defaultAccent</item>
<item name="themeBackground">@color/background_holo_light</item>
<item name="themeTextColor">@color/defaultText</item>
<item name="themeTextColorSecondary">@color/defaultTextSecondary</item>
<item name="themeTextColorDull">@color/defaultDull</item>
<item name="themeCardBackground">@color/dove</item>
<item name="themeMenuCal">@drawable/ic_action_cal</item>
</style>
<style name="CustomToolbar" parent="ThemeOverlay.AppCompat.Light">
<item name="android:textColorPrimary">?themeTextColorSecondary</item>
<item name="android:textColorSecondary">?themeTextColorSecondary</item>
<item name="android:background">?themePrimary</item>
</style>
<style name="ThemeOverlay.MyTheme" parent="ThemeOverlay.AppCompat.Light">
<item name="android:colorBackground">#f0f0f0</item>
<item name="colorControlHighlight">#f0f0f0</item>
<item name="android:textColor">#000000</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
......@@ -3,13 +3,13 @@ package com.flimbis.qi_core.entity;
/*
* Events are course schedules, school functions
* */
public class Event extends Task{
public class EventEntity extends Task{
private String id;
private String host;
private String venue;
private int duration;//in mins
public Event(int taskId, String name, String id, String host, String venue, int duration) {
public EventEntity(int taskId, String name, String id, String host, String venue, int duration) {
super(taskId, name);
this.id = id;
this.host = host;
......
package com.flimbis.qi_core.interactor;
public class CreateTodo {
import com.flimbis.qi_core.entity.Todo;
import com.flimbis.qi_core.repository.TodoRepository;
import io.reactivex.Observable;
import io.reactivex.Scheduler;
public class CreateTodo extends UseCase<Long, Todo> {
private TodoRepository repository;
public CreateTodo(Scheduler uiThread, TodoRepository repository) {
super(uiThread);
this.repository = repository;
}
@Override
public Observable<Long> buildObservable(Todo todo) {
return repository.create(todo).toObservable();
}
}
package com.flimbis.qi_core.interactor;
public class DeleteTodo {
import com.flimbis.qi_core.repository.TodoRepository;
import io.reactivex.Observable;
import io.reactivex.Scheduler;
public class DeleteTodo extends UseCase<Long, Long> {
private TodoRepository repository;
public DeleteTodo(Scheduler uiThread, TodoRepository repository) {
super(uiThread);
this.repository = repository;
}
@Override
public Observable<Long> buildObservable(Long id) {
return repository.delete(id).toObservable();
}
}
package com.flimbis.qi_core.interactor;
import com.flimbis.qi_core.entity.EventEntity;
import com.flimbis.qi_core.repository.EventRepository;
import java.util.List;
import io.reactivex.Observable;
import io.reactivex.Scheduler;
public class GetAllEvents extends UseCase<List<EventEntity>, Integer> {
private EventRepository repository;
public GetAllEvents(EventRepository repository, Scheduler uiThread) {
super(uiThread);
this.repository = repository;
}
@Override
public Observable<List<EventEntity>> buildObservable(Integer p) {
return repository.getAll(p);
}
}
package com.flimbis.qi_core.interactor;
import com.flimbis.qi_core.entity.Todo;
import com.flimbis.qi_core.repository.TodoRepository;
import java.util.List;
import io.reactivex.Observable;
import io.reactivex.Scheduler;
public class GetAllTodos extends UseCase<List<Todo>, Integer> {
private TodoRepository repository;
public GetAllTodos(Scheduler uiThread, TodoRepository repository) {
super(uiThread);
this.repository = repository;
}
@Override
public Observable<List<Todo>> buildObservable(Integer p) {
return repository.getAll(p);
}
}
package com.flimbis.qi_core.interactor;
import com.flimbis.qi_core.entity.EventEntity;
import com.flimbis.qi_core.repository.EventRepository;
import io.reactivex.Observable;
import io.reactivex.Scheduler;
public class GetEvent extends UseCase<EventEntity,Long> {
private EventRepository repository;
public GetEvent(Scheduler uiThread, EventRepository repository) {
super(uiThread);
this.repository = repository;
}
@Override
public Observable<EventEntity> buildObservable(Long id) {
return repository.get(id).toObservable();
}
}
package com.flimbis.qi_core.interactor;
import com.flimbis.qi_core.entity.Task;
import com.flimbis.qi_core.repository.TaskRepository;
import java.util.List;
import io.reactivex.Observable;
import io.reactivex.Scheduler;
/*
* fetch current event or class, and todos
*
* */
public class GetRecentTasks extends UseCase<List<Task>, Void> {
private TaskRepository repository;
public GetRecentTasks(Scheduler uiThread, TaskRepository repository) {
super(uiThread);
this.repository = repository;
}
@Override
public Observable<List<Task>> buildObservable(Void p) {
return repository.getAll(0);
}
}
package com.flimbis.qi_core.interactor;
import com.flimbis.qi_core.entity.Todo;
import com.flimbis.qi_core.repository.TodoRepository;
import io.reactivex.Observable;
import io.reactivex.Scheduler;
public class GetTodo extends UseCase<Todo,Long>{
private TodoRepository repository;
public GetTodo(Scheduler uiThread, TodoRepository repository) {
super(uiThread);
this.repository = repository;
}
@Override
public Observable<Todo> buildObservable(Long id) {
return repository.get(id).toObservable();
}
}
package com.flimbis.qi_core.interactor;
public class UpdateTodo {
import com.flimbis.qi_core.entity.Todo;
import com.flimbis.qi_core.repository.TodoRepository;
import io.reactivex.Observable;
import io.reactivex.Scheduler;
public class UpdateTodo extends UseCase<Long, Todo> {
private TodoRepository repository;
public UpdateTodo(Scheduler uiThread, TodoRepository repository) {
super(uiThread);
this.repository = repository;
}
@Override
public Observable<Long> buildObservable(Todo todo) {
return repository.update(todo).toObservable();
}
}
package com.flimbis.qi_core.interactor;
public abstract class UseCase {
import io.reactivex.Observable;
import io.reactivex.Scheduler;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.observers.DisposableObserver;
import io.reactivex.schedulers.Schedulers;
public abstract class UseCase<T, Params> {
private final Scheduler mUiThread;
private final CompositeDisposable mCompositeDisposable;
public UseCase(Scheduler uiThread) {
this.mUiThread = uiThread;
this.mCompositeDisposable = new CompositeDisposable();
}
public abstract Observable<T> buildObservable(Params p);
public void execute(DisposableObserver<T> disposableObserver, Params p) {
if (disposableObserver == null) {
throw new IllegalArgumentException("disposableObserver must not be null");
}
final Observable<T> observable = this.buildObservable(p)
.subscribeOn(Schedulers.io())
.observeOn(mUiThread);
DisposableObserver observer = observable.subscribeWith(disposableObserver);
mCompositeDisposable.add(observer);
}
public void dispose() {
if (!mCompositeDisposable.isDisposed()) {
mCompositeDisposable.dispose();
}
}
}
package com.flimbis.qi_core.repository;
import java.util.List;
import io.reactivex.Observable;
import io.reactivex.Single;
public interface BaseRepository<T> {
Observable<List<T>> getAll(int page);
Single<T> get(long id);
}
package com.flimbis.qi_core.repository;
import com.flimbis.qi_core.entity.EventEntity;
public interface EventRepository extends BaseRepository<EventEntity>{
}
package com.flimbis.qi_core.repository;
import com.flimbis.qi_core.entity.Task;
public interface TaskRepository extends BaseRepository<Task>{
}
package com.flimbis.qi_core.repository;
import com.flimbis.qi_core.entity.Todo;
import io.reactivex.Single;
public interface TodoRepository extends BaseRepository<Todo> {
Single<Long> create(Todo todo);
Single<Long> update(Todo todo);
Single<Long> delete(long id);
}
package com.flimbis.qi_core.repository;
public interface UserRepository {
}