Skip to content

Commit

Permalink
second
Browse files Browse the repository at this point in the history
  • Loading branch information
shrestea committed Feb 18, 2018
1 parent 5e1719a commit 4d7316f
Show file tree
Hide file tree
Showing 44 changed files with 1,218 additions and 63 deletions.
2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ dependencies {





apply plugin: 'com.google.gms.google-services'
21 changes: 13 additions & 8 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,55 +32,56 @@
android:supportsRtl="true"
android:theme="@style/AppTheme">

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

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

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

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="com.example.eforezan.kuevents.MainActivity" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

</activity>

<activity android:name=".HomePage">
<intent-filter>
<action android:name="com.example.eforezan.kuevents.HomePage" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

<activity android:name=".RegisterActivity">
<intent-filter>
<action android:name="com.example.eforezan.kuevents.RegisterActivity" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

<activity android:name=".ProfileActivity">
<intent-filter>
<action android:name="com.example.eforezan.kuevents.ProfileActivity" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

<activity android:name=".second">
<intent-filter>
<action android:name="com.example.eforezan.kuevents.second" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

<activity android:name=".display_data">
<intent-filter>
<action android:name="com.example.eforezan.kuevents.display_data" />
Expand All @@ -89,7 +90,6 @@
</intent-filter>
</activity>


<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
Expand All @@ -113,9 +113,14 @@
android:label="@string/title_activity_maps">
<intent-filter>
<action android:name="com.example.eforezan.kuevents.MapsActivity" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".navigation"
android:label="@string/title_activity_navigation"
android:theme="@style/AppTheme.NoActionBar"></activity>
</application>

</manifest>
10 changes: 7 additions & 3 deletions app/src/main/java/com/example/eforezan/kuevents/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ public class Event {
private double Latitude;
private double Longitude;

public Event(){

}
public Event(){}



public Event(String title, String desc, String image, String start_date, String end_date, String start_time, String end_time, double Latitude, double Longitude) {
this.title = title;
Expand All @@ -29,7 +30,6 @@ public Event(String title, String desc, String image, String start_date, String
this.end_time = end_time;
this.Latitude = Latitude;
this.Longitude = Longitude;

}

public String getTitle() {
Expand All @@ -40,6 +40,10 @@ public void setTitle(String title) {
this.title = title;
}

public String getDesc() {return desc;}

public void setDesc(String desc) {this.desc = desc;}

public String getImage() {
return image;
}
Expand Down
55 changes: 53 additions & 2 deletions app/src/main/java/com/example/eforezan/kuevents/HomePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@

import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
Expand All @@ -24,7 +30,7 @@
import com.google.firebase.database.ValueEventListener;
import com.squareup.picasso.Picasso;

public class HomePage extends AppCompatActivity {
public class HomePage extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {

private RecyclerView mEventList;

Expand All @@ -47,6 +53,19 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home_page);

Toolbar toolbar = (Toolbar) findViewById( R.id.toolbar );
setSupportActionBar( toolbar );

DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle;
toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.addDrawerListener(toggle);
toggle.syncState();

NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);

mAuth = FirebaseAuth.getInstance();
mCurrentUser = mAuth.getCurrentUser();
if(mCurrentUser == null){
Expand Down Expand Up @@ -106,7 +125,7 @@ public void onClick(View view) {
@Override
public void onClick(View view) {
mProcessGoing = true;
mDatabase.addValueEventListener(new ValueEventListener() {
mDatabase.child( "Events" ).addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
if (mProcessGoing){
Expand Down Expand Up @@ -141,6 +160,36 @@ public void onCancelled(DatabaseError databaseError) {

}


@Override
public void onBackPressed() {
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
if (drawer.isDrawerOpen( GravityCompat.START)) {
drawer.closeDrawer(GravityCompat.START);
} else {
super.onBackPressed();
}
}

@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
int id = item.getItemId();

if (id == R.id.profile) {
// setFragment(new profile());
}
else if (id == R.id.events) {
//startActivity( new Intent(MainActivity.this, HomePage.class ) );
}
else if (id == R.id.location) {
Intent i = new Intent(HomePage.this, MapsActivity.class);
startActivity(i);
}
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
}

public static class EventViewHolder extends RecyclerView.ViewHolder{

View mView;
Expand Down Expand Up @@ -270,4 +319,6 @@ public void onCancelled(DatabaseError databaseError) {

return super.onOptionsItemSelected(item);
}


}
Loading

0 comments on commit 4d7316f

Please sign in to comment.