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
46 changes: 46 additions & 0 deletions .idea/assetWizardSettings.xml

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

Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
7 changes: 7 additions & 0 deletions .idea/kotlinc.xml

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

2 changes: 1 addition & 1 deletion .idea/misc.xml

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

4 changes: 4 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:design:27.1.1'
}
6 changes: 4 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".HomeActivity">
<activity android:name=".HomeActivity" />
<activity android:name=".SplashActivity" />
<activity android:name=".Courses">

</activity>
<activity android:name=".SplashActivity">
<activity android:name=".LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
47 changes: 47 additions & 0 deletions app/src/main/java/com/example/mypc/firstskool/Courses.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.example.mypc.firstskool;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import java.util.Arrays;
import java.util.List;

public class Courses extends AppCompatActivity {

private RecyclerView recyclerView1, recyclerView2;
private RecyclerView.LayoutManager layoutManager, layoutManager2;
private List<String> listClass;
private List<String> listExams;
private RecyclerViewAdapter adapter, adapter2;


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_courses);

// ----------- First Recycler view for class ------------------------

recyclerView1 = findViewById(R.id.recyclerview);
layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
recyclerView1.setLayoutManager(layoutManager);
listClass = Arrays.asList(getResources().getStringArray(R.array.Class));
adapter = new RecyclerViewAdapter(listClass);
recyclerView1.setHasFixedSize(true);
recyclerView1.setAdapter(adapter);



// --------------- Second recycler view for Exams --------------------
recyclerView2 = findViewById(R.id.recyclerviewexams);
layoutManager2 = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
recyclerView2.setLayoutManager(layoutManager2);
listExams = Arrays.asList(getResources().getStringArray(R.array.Exams));
adapter2 = new RecyclerViewAdapter(listExams);
recyclerView2.setAdapter(adapter2);


}
}
181 changes: 181 additions & 0 deletions app/src/main/java/com/example/mypc/firstskool/LoginActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
package com.example.mypc.firstskool;

import android.content.DialogInterface;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.RelativeLayout;

import com.rengwuxian.materialedittext.MaterialEditText;

public class LoginActivity extends AppCompatActivity {

private Button btnSignIn;
private Button btnregister;

RelativeLayout rootLayout;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);

btnSignIn = findViewById(R.id.btnSignIn);
btnregister = findViewById(R.id.btnRegister);
rootLayout = findViewById(R.id.rootLayout);

btnregister.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showRegisterDialog();
}
});

btnSignIn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showLoginDialog();
}
});
}



private void showLoginDialog() {

final AlertDialog.Builder dialog = new AlertDialog.Builder(this);
dialog.setTitle("SIGN IN ");
dialog.setMessage("Please use Email to Sign In");

LayoutInflater inflater = LayoutInflater.from(this);
View login_layout = inflater.inflate(R.layout.login_layout, null);

final MaterialEditText edtemail = login_layout.findViewById(R.id.edtemail);
final MaterialEditText edtpassword = login_layout.findViewById(R.id.edtpassword);


dialog.setView(login_layout);

dialog.setPositiveButton("SIGN IN", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {

dialogInterface.dismiss();
btnSignIn.setEnabled(false);



//Checking Fields

if (TextUtils.isEmpty(edtemail.getText().toString())) {

Snackbar.make(rootLayout, "Please enter Email id", Snackbar.LENGTH_SHORT).show();
return;
}
if (TextUtils.isEmpty(edtpassword.getText().toString())) {

Snackbar.make(rootLayout, "Please enter Password", Snackbar.LENGTH_SHORT).show();
return;
}

if ((edtpassword.getText().toString().length() < 8)) {

Snackbar.make(rootLayout, "Password should be minimum of 8 characters", Snackbar.LENGTH_SHORT).show();
return;
}

// ----------------------------Login Code here -----------------



}
});


dialog.setNegativeButton("CANCEL", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
});


dialog.show();


}

private void showRegisterDialog() {

final AlertDialog.Builder dialog = new AlertDialog.Builder(this);
dialog.setTitle("REGISTER ");
dialog.setMessage("Please use Email to register");

LayoutInflater inflater = LayoutInflater.from(this);
View register_layout = inflater.inflate(R.layout.register_layout, null);

final MaterialEditText edtemail = register_layout.findViewById(R.id.edtemail);
final MaterialEditText edtpassword = register_layout.findViewById(R.id.edtpassword);
final MaterialEditText edtname = register_layout.findViewById(R.id.edtname);
final MaterialEditText edtphone = register_layout.findViewById(R.id.edtphone);

dialog.setView(register_layout);

dialog.setPositiveButton("REGISTER", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {

dialogInterface.dismiss();

//Checking about fields

if (TextUtils.isEmpty(edtemail.getText().toString())) {

Snackbar.make(rootLayout, "Please enter Email id", Snackbar.LENGTH_SHORT).show();
return;
}
if (TextUtils.isEmpty(edtpassword.getText().toString())) {

Snackbar.make(rootLayout, "Please enter Password", Snackbar.LENGTH_SHORT).show();
return;
}
if (TextUtils.isEmpty(edtname.getText().toString())) {

Snackbar.make(rootLayout, "Please enter Your Name", Snackbar.LENGTH_SHORT).show();
return;
}
if (TextUtils.isEmpty(edtphone.getText().toString())) {

Snackbar.make(rootLayout, "Please enter Phone", Snackbar.LENGTH_SHORT).show();
return;
}
if ((edtpassword.getText().toString().length() < 6)) {

Snackbar.make(rootLayout, "Password should be minimum of 8 characters", Snackbar.LENGTH_SHORT).show();
return;
}

// Create new user


}
});

dialog.setNegativeButton("CANCEL", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {

dialogInterface.dismiss();

}
});

dialog.show();

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package com.example.mypc.firstskool;

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.ImageView;
import android.widget.TextView;

import java.util.List;

public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.MyViewHolder> {

private List<String> list;

public RecyclerViewAdapter(List<String> list){
this.list = list;
}


@NonNull
@Override
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {

View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.single_course,parent,false);
MyViewHolder myViewHolder = new MyViewHolder(view);
return myViewHolder;
}

@Override
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {

holder.album.setImageResource(R.drawable.defaultavatar);
holder.album_title.setText(list.get(position));

}

@Override
public int getItemCount() {
return list.size();
}

public static class MyViewHolder extends RecyclerView.ViewHolder{

ImageView album;
TextView album_title;

public MyViewHolder(View itemView) {
super(itemView);

album = itemView.findViewById(R.id.album);
album_title = itemView.findViewById(R.id.album_title);
}
}
}
Binary file added app/src/main/res/drawable/defaultavatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_arrow_forward_black_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,4l-1.41,1.41L16.17,11H4v2h12.17l-5.58,5.59L12,20l8,-8z"/>
</vector>
Loading