Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ChandelAnushka committed Oct 16, 2019
0 parents commit dd96ecf
Show file tree
Hide file tree
Showing 110 changed files with 2,113 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
4 changes: 4 additions & 0 deletions .idea/encodings.xml

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

15 changes: 15 additions & 0 deletions .idea/gradle.xml

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

14 changes: 14 additions & 0 deletions .idea/misc.xml

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

12 changes: 12 additions & 0 deletions .idea/runConfigurations.xml

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

1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
37 changes: 37 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 29
buildToolsVersion "29.0.1"
defaultConfig {
applicationId "com.example.enrollege"
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'androidx.recyclerview:recyclerview:1.0.0-beta01'
implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.android.support:design:22.2.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.viewpager:viewpager:1.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
21 changes: 21 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.example.enrollege;

import android.content.Context;

import androidx.test.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("com.example.enrollege", appContext.getPackageName());
}
}
23 changes: 23 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.enrollege">

<application
android:allowBackup="true"
android:icon="@drawable/logo"
android:label="@string/app_name"
android:roundIcon="@drawable/logo"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".Activities.SplashScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Activities.MainActivity">
</activity>
</application>

</manifest>
76 changes: 76 additions & 0 deletions app/src/main/java/com/example/enrollege/Activities/Dashboard.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package com.example.enrollege.Activities;

import android.os.Bundle;
import android.util.Log;

import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.ViewPager;

import com.example.enrollege.Fragments.AllPostsFragment;
import com.example.enrollege.Fragments.MyPostsFragment;
import com.example.enrollege.R;
import com.google.android.material.tabs.TabLayout;

import java.util.ArrayList;

public class Dashboard extends AppCompatActivity {
ViewPager viewPager;
TabLayout tabs;

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

tabs = findViewById(R.id.tabs);
viewPager = findViewById(R.id.viewpager);
viewPager.setAdapter(new DashboardPagerAdapter(getSupportFragmentManager()));
tabs.setupWithViewPager(viewPager);

tabs.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
viewPager.setCurrentItem(tab.getPosition(),true);
}

@Override
public void onTabUnselected(TabLayout.Tab tab) {

}

@Override
public void onTabReselected(TabLayout.Tab tab) {

}

});


}

class DashboardPagerAdapter extends FragmentPagerAdapter {

ArrayList<Fragment> fragments;

public DashboardPagerAdapter(FragmentManager fm) {
super(fm);
Log.i("hi" , "hi");
fragments = new ArrayList<>();
fragments.add(0,new AllPostsFragment());
fragments.add(1,new MyPostsFragment());
}

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

@Override
public int getCount() {
return 3;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.example.enrollege.Activities;

import androidx.appcompat.app.AppCompatActivity;
import androidx.core.view.GravityCompat;
import androidx.drawerlayout.widget.DrawerLayout;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.example.enrollege.R;

public class MainActivity extends AppCompatActivity {

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

final DrawerLayout dashboard = (DrawerLayout) findViewById(R.id.dashboardNavigationDrawer);
ImageView toolbarNavigationOpenner=(ImageView)findViewById(R.id.toolbarNavigationOpenner);
toolbarNavigationOpenner.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dashboard.openDrawer(GravityCompat.START);
}
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package com.example.enrollege.Activities;

import android.content.Intent;
import android.os.Bundle;
import android.text.Layout;
import android.view.Gravity;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.LinearInterpolator;
import android.widget.ImageView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.core.view.GravityCompat;
import androidx.drawerlayout.widget.DrawerLayout;

import com.example.enrollege.R;

public class SplashScreen extends AppCompatActivity {

private Layout layout;
private ImageView logo;
private View view;
private ImageView signin;

Animation animFade;

@Override
protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);

view = (View)findViewById(R.id.view);
signin = (ImageView)findViewById(R.id.signin);
logo=(ImageView) findViewById(R.id.logo);


animFade = AnimationUtils.loadAnimation(getApplicationContext(),
R.anim.item_fall_down );
animFade.setInterpolator(new LinearInterpolator());
animFade.setRepeatCount(Animation.INFINITE);
animFade.setDuration(2000);
logo.startAnimation(animFade);

view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
signin.setVisibility(View.VISIBLE);
}
});

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

}
private void launchActivity() {

Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
}

}


Loading

0 comments on commit dd96ecf

Please sign in to comment.