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
1 change: 1 addition & 0 deletions .idea/.name

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

12 changes: 8 additions & 4 deletions .idea/gradle.xml

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

25 changes: 25 additions & 0 deletions .idea/jarRepositories.xml

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

5 changes: 5 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
Expand All @@ -46,4 +47,8 @@ dependencies {
// implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services:12.0.1'
implementation 'com.google.android.material:material:1.0.0'
implementation 'org.jetbrains:annotations-java5:15.0'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.google.code.gson:gson:2.8.6'

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import android.content.Context;

import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;

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

import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;

/**
* Instrumented test, which will execute on an Android device.
Expand Down
Binary file added app/src/main - Ярлык.lnk
Binary file not shown.
8 changes: 6 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true">
<activity android:name=".PlacesActivity"></activity>

<uses-library
android:name="org.apache.http.legacy"
android:required="false" />

<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyB6pGRqJd5r608l3gou4OIKExdWcBFtPKU" />
android:value="AIzaSyD4SHywIY-5Z4t_zs1O89Iy9eyvNt2QfdY" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
Expand All @@ -34,6 +37,7 @@
</intent-filter>
</activity>
<activity android:name=".MapActivity" />
<activity android:name=".EventsActivity" />
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.example.webapplicationwithspring;

import android.app.Fragment;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.example.webapplicationwithspring.Events.EventsController;

// class for the event fragment click
public class EventFragment extends Fragment {
// static class creation with parameter index, index is needed to display particular event from eventController
public static EventFragment newInstance(int index) {
EventFragment f = new EventFragment();
Bundle args = new Bundle();
args.putInt("index", index);
f.setArguments(args);
return f;
}

// here we initialize all the data to eventFragment layout and return the View
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
LayoutInflater layoutInflater = (LayoutInflater) getActivity().getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View event = layoutInflater.inflate(R.layout.event, null, false);
TextView name = event.findViewById(R.id.textView_name);
TextView date = event.findViewById(R.id.textView_date);
TextView description = event.findViewById(R.id.textView_description);
TextView place = event.findViewById(R.id.textView_place);

name.setText(EventsController.getEvent(getArguments().getInt("index",0)).getEventName());
date.setText(EventsController.getEvent(getArguments().getInt("index",0)).getEventDate());
description.setText(EventsController.getEvent(getArguments().getInt("index",0)).getEventDescription());
place.setText(EventsController.getEvent(getArguments().getInt("index",0)).getEventPlace());

return event;
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package com.example.webapplicationwithspring.Events;

public class Event {
private String eventName;
private String eventDate;
private String eventDescription;
private String eventPlace;
private int id;



public Event(String eventName, String eventDate, String eventDescription, String eventPlace, int id) {
this.eventName = eventName;
this.eventDate = eventDate;
this.eventDescription = eventDescription;
this.eventPlace = eventPlace;
this.id = id;
}

public String getEventName() {
return eventName;
}

public void setEventName(String eventName) {
this.eventName = eventName;
}

public String getEventDate() {
return eventDate;
}

public void setEventDate(String eventDate) {
this.eventDate = eventDate;
}

public String getEventDescription() {
return eventDescription;
}

public void setEventDescription(String eventDescription) {
this.eventDescription = eventDescription;
}

public String getEventPlace() {
return eventPlace;
}

public void setEventPlace(String eventPlace) {
this.eventPlace = eventPlace;
}

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.example.webapplicationwithspring.Events;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

public class EventsController {
private static Map<Integer,Event> eventsMap= new HashMap<Integer,Event>();
public static void addEvent(String eventName, String eventDate, String eventDescription, String eventPlace, int id){
eventsMap.put(id, new Event(eventName,eventDate,eventDescription,eventPlace,id));
}
public static Event getEvent(int index){
return eventsMap.get(index);
}
public static Collection<Event> getValue(){
return eventsMap.values();
}
public static int getSize(){ return eventsMap.size(); }

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
package com.example.webapplicationwithspring.Events;

public class Place {
private String location;
private String name;
private String description;
private String workHours;
private String address;
private String telegram;
private String phoneNumber;
private int id;

public Place(String name, String location, String description, String workHours,String address, String telegram, String phoneNumber, int id) {
this.location = location;
this.name = name;
this.description = description;
this.workHours = workHours;
this.address = address;
this.telegram = telegram;
this.phoneNumber = phoneNumber;
this.id = id;

}

public String getLocation() {
return location;
}

public void setLocation(String location) {
this.location = location;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public String getWorkHours() {
return workHours;
}

public void setWorkHours(String workHours) {
this.workHours = workHours;
}

public String getAddress() {
return address;
}

public void setAddress(String adress) {
this.address = adress;
}

public String getTelegram() {
return telegram;
}

public void setTelegram(String telegram) {
this.telegram = telegram;
}

public String getPhoneNumber() {
return phoneNumber;
}

public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.example.webapplicationwithspring.Events;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

public class PlacesController {
public static Map<Integer, Place> placesMap = new HashMap<Integer, Place>();
public static void addEvent(String name, String location, String description, String workHours,String address, String telegram, String phoneNumbe, int id){
placesMap.put(id, new Place(name, location,description,workHours,address,telegram,phoneNumbe,id));
}
public static Place getPlace(int index){
return placesMap.get(index);
}
public static Collection<Place> getValue(){
return placesMap.values();
}
public static int getSize(){ return placesMap.size(); }

}
Loading