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

Home Activity And Fragments Implementation (UI ONLY) #12

Merged
merged 1 commit into from
Jul 30, 2021
Merged
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
9 changes: 9 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'org.jetbrains:annotations:15.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
Expand All @@ -64,4 +66,11 @@ dependencies {

// PDF reader Library
implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'

// Bubble Navigation - Bottom Navigation
implementation 'com.gauravk.bubblenavigation:bubblenavigation:1.0.7'

// Android Chart Library For Statistics
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'

}
3 changes: 1 addition & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Aether">

<activity android:name=".views.home.HomeActivity"></activity>
<activity android:name=".views.LoginActivity" />
<activity android:name=".views.RegistrationActivity" />

<activity
android:name=".SplashActivity"
android:launchMode="singleTask">
Expand Down
4 changes: 4 additions & 0 deletions android/app/src/main/java/life/nsu/aether/SplashActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@

package life.nsu.aether;

import android.content.Intent;
import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.ViewModelProvider;

import life.nsu.aether.viewModels.SplashActivityViewModel;
import life.nsu.aether.views.home.HomeActivity;

public class SplashActivity extends AppCompatActivity {

Expand All @@ -26,5 +28,7 @@ protected void onCreate(Bundle savedInstanceState) {

viewModel = new ViewModelProvider(this).get(SplashActivityViewModel.class);

// Temporary redirect for test purposes
startActivity(new Intent(this, HomeActivity.class));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* HomePageFragmentSliderAdapter Created by Samiur Prapon
* Last modified 24/7/21, 3:02 pm
* Copyright (c) 2021. All rights reserved.
*
*/

package life.nsu.aether.utils.adapters;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;

import java.util.ArrayList;

public class HomePageFragmentSliderAdapter extends FragmentStatePagerAdapter {

ArrayList<Fragment> fragments;

public HomePageFragmentSliderAdapter(ArrayList<Fragment> fragments, FragmentManager fm, int behavior) {
super(fm, behavior);
this.fragments = fragments;
}

@NonNull
@Override
public Fragment getItem(int position) {
return fragments.get(position);
}

@Override
public int getCount() {
return fragments.size();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ protected void onCreate(Bundle savedInstanceState) {
// mSignUp.setError(null);
new Handler(Looper.myLooper()).postDelayed(() -> {
viewModel.register(email, password, type);

// loadingDialog.hide();

}, 250);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* ClassesFragment Created by Samiur Prapon
* Last modified 17/7/21, 11:12 am
* Copyright (c) 2021. All rights reserved.
*
*/

package life.nsu.aether.views.fragments;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import life.nsu.aether.R;

/**
* A simple {@link Fragment} subclass.
* Use the {@link ClassesFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class ClassesFragment extends Fragment {

// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";

// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;

public ClassesFragment() {
// Required empty public constructor
}

/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment ClassesFragment.
*/
// TODO: Rename and change types and number of parameters
public static ClassesFragment newInstance(String param1, String param2) {
ClassesFragment fragment = new ClassesFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_classes, container, false);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* CoursesFragment Created by Samiur Prapon
* Last modified 17/7/21, 11:12 am
* Copyright (c) 2021. All rights reserved.
*
*/

package life.nsu.aether.views.fragments;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import life.nsu.aether.R;

/**
* A simple {@link Fragment} subclass.
* Use the {@link CoursesFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class CoursesFragment extends Fragment {

// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";

// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;

public CoursesFragment() {
// Required empty public constructor
}

/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment CoursesFragment.
*/
// TODO: Rename and change types and number of parameters
public static CoursesFragment newInstance(String param1, String param2) {
CoursesFragment fragment = new CoursesFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_courses, container, false);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* ExamFragment Created by Samiur Prapon
* Last modified 17/7/21, 11:12 am
* Copyright (c) 2021. All rights reserved.
*
*/

package life.nsu.aether.views.fragments;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import life.nsu.aether.R;

/**
* A simple {@link Fragment} subclass.
* Use the {@link ExamFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class ExamFragment extends Fragment {

// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";

// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;

public ExamFragment() {
// Required empty public constructor
}

/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment ExamFragment.
*/
// TODO: Rename and change types and number of parameters
public static ExamFragment newInstance(String param1, String param2) {
ExamFragment fragment = new ExamFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_exam, container, false);
}
}
Loading