Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
JoinTheCity
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rafal
JoinTheCity
Commits
babaa230
Commit
babaa230
authored
Jan 10, 2016
by
Rafal
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
2961c072
0e50a5a6
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
593 additions
and
17 deletions
+593
-17
misc.xml
JoinTheCityAPP/.idea/misc.xml
+16
-0
vcs.xml
JoinTheCityAPP/.idea/vcs.xml
+0
-1
app.iml
JoinTheCityAPP/app/app.iml
+62
-4
build.gradle
JoinTheCityAPP/app/build.gradle
+6
-1
google_maps_api.xml
JoinTheCityAPP/app/src/debug/res/values/google_maps_api.xml
+21
-0
AndroidManifest.xml
JoinTheCityAPP/app/src/main/AndroidManifest.xml
+36
-1
ApiObject.java
.../java/anotherlineofcode/com/jointhecityapp/ApiObject.java
+20
-0
FriendsActivity.java
...anotherlineofcode/com/jointhecityapp/FriendsActivity.java
+30
-0
MainActivity.java
...va/anotherlineofcode/com/jointhecityapp/MainActivity.java
+69
-3
MainContentFragment.java
...herlineofcode/com/jointhecityapp/MainContentFragment.java
+32
-0
MapsActivity.java
...va/anotherlineofcode/com/jointhecityapp/MapsActivity.java
+55
-0
RecyclerViewAdapter.java
...herlineofcode/com/jointhecityapp/RecyclerViewAdapter.java
+40
-0
RecyclerViewHolders.java
...herlineofcode/com/jointhecityapp/RecyclerViewHolders.java
+25
-0
cinema512.png
JoinTheCityAPP/app/src/main/res/drawable/cinema512.png
+0
-0
invert512.png
JoinTheCityAPP/app/src/main/res/drawable/invert512.png
+0
-0
activity_friends.xml
JoinTheCityAPP/app/src/main/res/layout/activity_friends.xml
+25
-0
activity_main.xml
JoinTheCityAPP/app/src/main/res/layout/activity_main.xml
+15
-5
activity_maps.xml
JoinTheCityAPP/app/src/main/res/layout/activity_maps.xml
+6
-0
card_view_list.xml
JoinTheCityAPP/app/src/main/res/layout/card_view_list.xml
+41
-0
content_friends.xml
JoinTheCityAPP/app/src/main/res/layout/content_friends.xml
+13
-0
fragment_main_content.xml
...CityAPP/app/src/main/res/layout/fragment_main_content.xml
+10
-0
fragment_map.xml
JoinTheCityAPP/app/src/main/res/layout/fragment_map.xml
+10
-0
menu_main.xml
JoinTheCityAPP/app/src/main/res/menu/menu_main.xml
+30
-2
styles.xml
JoinTheCityAPP/app/src/main/res/values-v21/styles.xml
+2
-0
dimens.xml
JoinTheCityAPP/app/src/main/res/values/dimens.xml
+1
-0
strings.xml
JoinTheCityAPP/app/src/main/res/values/strings.xml
+5
-0
styles.xml
JoinTheCityAPP/app/src/main/res/values/styles.xml
+2
-0
google_maps_api.xml
...TheCityAPP/app/src/release/res/values/google_maps_api.xml
+21
-0
No files found.
JoinTheCityAPP/.idea/misc.xml
View file @
babaa230
...
...
@@ -43,4 +43,20 @@
<component
name=
"ProjectType"
>
<option
name=
"id"
value=
"Android"
/>
</component>
<component
name=
"masterDetails"
>
<states>
<state
key=
"ProjectJDKs.UI"
>
<settings>
<last-edited>
1.8
</last-edited>
<splitter-proportions>
<option
name=
"proportions"
>
<list>
<option
value=
"0.2"
/>
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>
\ No newline at end of file
JoinTheCityAPP/.idea/vcs.xml
View file @
babaa230
...
...
@@ -2,6 +2,5 @@
<project
version=
"4"
>
<component
name=
"VcsDirectoryMappings"
>
<mapping
directory=
""
vcs=
""
/>
<mapping
directory=
"$PROJECT_DIR$/.."
vcs=
"Git"
/>
</component>
</project>
\ No newline at end of file
JoinTheCityAPP/app/app.iml
View file @
babaa230
...
...
@@ -21,7 +21,7 @@
<option
name=
"ALLOW_USER_CONFIGURATION"
value=
"false"
/>
<option
name=
"MANIFEST_FILE_RELATIVE_PATH"
value=
"/src/main/AndroidManifest.xml"
/>
<option
name=
"RES_FOLDER_RELATIVE_PATH"
value=
"/src/main/res"
/>
<option
name=
"RES_FOLDERS_RELATIVE_PATH"
value=
"file://$MODULE_DIR$/src/main/res"
/>
<option
name=
"RES_FOLDERS_RELATIVE_PATH"
value=
"file://$MODULE_DIR$/src/main/res
;file://$MODULE_DIR$/src/debug/res
"
/>
<option
name=
"ASSETS_FOLDER_RELATIVE_PATH"
value=
"/src/main/assets"
/>
</configuration>
</facet>
...
...
@@ -73,8 +73,37 @@
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/dex-cache"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/cn.pedant.sweetalert/library/1.3/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/cardview-v7/23.1.1/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/23.1.1/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/mediarouter-v7/22.2.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.1.1/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.1/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.github.medyo/fancybuttons/1.5/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-ads/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-analytics/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-appindexing/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-appinvite/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-appstate/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-auth/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-basement/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-cast/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-drive/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-fitness/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-games/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-gcm/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-identity/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-location/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-maps/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-measurement/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-nearby/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-panorama/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-plus/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-safetynet/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-vision/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-wallet/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-wearable/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services/8.3.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.pnikosis/materialish-progress/1.0/jars"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/incremental"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/jacoco"
/>
...
...
@@ -93,13 +122,42 @@
</content>
<orderEntry
type=
"jdk"
jdkName=
"Android API 23 Platform"
jdkType=
"Android SDK"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
<orderEntry
type=
"library"
exported=
""
name=
"library-1.3"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"support-v4-23.1.1"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"mediarouter-v7-22.2.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-location-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-plus-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-appindexing-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-auth-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-wearable-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"fancybuttons-1.5"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-base-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-measurement-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-identity-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-vision-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-wallet-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"recyclerview-v7-23.1.1"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"support-v4-23.1.1"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-analytics-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-drive-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"httpclient-4.3.6"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"support-annotations-23.1.1"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"appcompat-v7-23.1.1"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"android-async-http-1.4.9"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-cast-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-ads-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-appinvite-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-appstate-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"cardview-v7-23.1.1"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-games-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-gcm-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-safetynet-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"materialish-progress-1.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"design-23.1.1"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"library-1.3"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-maps-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-basement-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-nearby-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-fitness-8.3.0"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"android-async-http-1.4.9"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"play-services-panorama-8.3.0"
level=
"project"
/>
</component>
</module>
\ No newline at end of file
JoinTheCityAPP/app/build.gradle
View file @
babaa230
...
...
@@ -6,7 +6,7 @@ android {
defaultConfig
{
applicationId
"anotherlineofcode.com.jointhecityapp"
minSdkVersion
15
minSdkVersion
21
targetSdkVersion
23
versionCode
1
versionName
"1.0"
...
...
@@ -25,4 +25,9 @@ dependencies {
compile
'com.loopj.android:android-async-http:1.4.9'
compile
'cn.pedant.sweetalert:library:1.3'
compile
'com.github.medyo:fancybuttons:1.5@aar'
compile
'com.google.android.gms:play-services-maps:8.3.0'
compile
'com.google.android.gms:play-services:8.3.0'
compile
'com.android.support:design:23.1.1'
compile
'com.android.support:cardview-v7:23.1.1'
compile
'com.android.support:recyclerview-v7:23.1.1'
}
JoinTheCityAPP/app/src/debug/res/values/google_maps_api.xml
0 → 100644
View file @
babaa230
<resources>
<!--
TODO: Before you run your application, you need a Google Maps API key.
To get one, follow this link, follow the directions and press "Create" at the end:
https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=25:22:9C:09:F0:8F:2C:87:22:4E:8E:75:BA:C7:3B:C4:C0:D5:4E:AF%3Banotherlineofcode.com.jointhecityapp
You can also add your credentials to an existing key, using this line:
25:22:9C:09:F0:8F:2C:87:22:4E:8E:75:BA:C7:3B:C4:C0:D5:4E:AF;anotherlineofcode.com.jointhecityapp
Alternatively, follow the directions here:
https://developers.google.com/maps/documentation/android/start#get-key
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
string in this file.
-->
<string
name=
"google_maps_key"
translatable=
"false"
templateMergeStrategy=
"preserve"
>
AIzaSyAKbhGUdcjjDMiPW4OW_zAlE85GgaOQ7p8
</string>
</resources>
JoinTheCityAPP/app/src/main/AndroidManifest.xml
View file @
babaa230
...
...
@@ -5,11 +5,18 @@
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but you must specify either coarse or fine
location permissions for the 'MyLocation' functionality.
-->
<uses-permission
android:name=
"android.permission.ACCESS_FINE_LOCATION"
/>
<application
android:allowBackup=
"true"
android:icon=
"@mipmap/ic_launcher"
android:label=
"@string/app_name"
android:theme=
"@style/
AppTheme
"
android:theme=
"@style/
Theme.AppCompat.Light
"
tools:replace=
"android:icon"
>
<activity
android:name=
".MainActivity"
...
...
@@ -25,6 +32,34 @@
android:name=
".LoginAndRegistrationActivity"
android:label=
"@string/title_activity_login_and_registration"
>
</activity>
<!--
The API key for Google Maps-based APIs is defined as a string resource.
(See the file "res/values/google_maps_api.xml").
Note that the API key is linked to the encryption key used to sign the APK.
You need a different API key for each encryption key, including the release key that is used to
sign the APK for publishing.
You can define the keys for the debug and release targets in src/debug/ and src/release/.
-->
<meta-data
android:name=
"com.google.android.geo.API_KEY"
android:value=
"@string/google_maps_key"
/>
<activity
android:name=
".MapsActivity"
android:label=
"@string/title_activity_maps"
>
<meta-data
android:name=
"android.support.PARENT_ACTIVITY"
android:value=
"anotherlineofcode.com.jointhecityapp.MainActivity"
/>
</activity>
<activity
android:name=
".FriendsActivity"
android:label=
"@string/title_activity_friends"
android:parentActivityName=
".MainActivity"
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
>
<meta-data
android:name=
"android.support.PARENT_ACTIVITY"
android:value=
"anotherlineofcode.com.jointhecityapp.MainActivity"
/>
</activity>
</application>
</manifest>
JoinTheCityAPP/app/src/main/java/anotherlineofcode/com/jointhecityapp/ApiObject.java
0 → 100644
View file @
babaa230
package
anotherlineofcode
.
com
.
jointhecityapp
;
public
class
ApiObject
{
private
String
name
;
private
int
photo
;
ApiObject
(
String
name
,
int
photo
){
this
.
name
=
name
;
this
.
photo
=
photo
;
}
public
String
getName
()
{
return
name
;
}
public
int
getPhoto
()
{
return
photo
;
}
}
JoinTheCityAPP/app/src/main/java/anotherlineofcode/com/jointhecityapp/FriendsActivity.java
0 → 100644
View file @
babaa230
package
anotherlineofcode
.
com
.
jointhecityapp
;
import
android.os.Bundle
;
import
android.support.design.widget.FloatingActionButton
;
import
android.support.design.widget.Snackbar
;
import
android.support.v7.app.AppCompatActivity
;
import
android.support.v7.widget.Toolbar
;
import
android.view.View
;
public
class
FriendsActivity
extends
AppCompatActivity
{
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_friends
);
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar
);
setSupportActionBar
(
toolbar
);
FloatingActionButton
fab
=
(
FloatingActionButton
)
findViewById
(
R
.
id
.
fab
);
fab
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
Snackbar
.
make
(
view
,
"Replace with your own action"
,
Snackbar
.
LENGTH_LONG
)
.
setAction
(
"Action"
,
null
).
show
();
}
});
getSupportActionBar
().
setDisplayHomeAsUpEnabled
(
true
);
}
}
JoinTheCityAPP/app/src/main/java/anotherlineofcode/com/jointhecityapp/MainActivity.java
View file @
babaa230
package
anotherlineofcode
.
com
.
jointhecityapp
;
import
android.app.FragmentTransaction
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.SharedPreferences
;
import
android.support.v4.app.Fragment
;
import
android.support.v7.app.AppCompatActivity
;
import
android.os.Bundle
;
import
android.support.v7.widget.GridLayoutManager
;
import
android.support.v7.widget.RecyclerView
;
import
android.view.Menu
;
import
android.view.MenuItem
;
import
com.google.android.gms.maps.MapFragment
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
MainActivity
extends
AppCompatActivity
{
public
final
static
int
LOGIN_REQUEST
=
1
;
private
MapFragment
mMapFragment
;
private
SharedPreferences
sharedPreferences
;
private
GridLayoutManager
lLayout
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_main
);
getSupportActionBar
().
setDisplayShowTitleEnabled
(
false
);
sharedPreferences
=
getSharedPreferences
(
"JoinTheCityPreferences"
,
Context
.
MODE_PRIVATE
);
SharedPreferences
.
Editor
editor
=
sharedPreferences
.
edit
();
editor
.
putInt
(
"lat"
,
50
);
editor
.
putInt
(
"lng"
,
19
);
editor
.
commit
();
// Check if user is logged in, if not open login activity
if
(!
isLoggedIn
())
{
Intent
intent
=
new
Intent
(
this
,
LoginAndRegistrationActivity
.
class
);
startActivityForResult
(
intent
,
LOGIN_REQUEST
);
}
if
(
savedInstanceState
==
null
)
{
// Add header and main menu fragments
getFragmentManager
().
beginTransaction
().
add
(
R
.
id
.
content
,
new
MainContentFragment
(),
"MainContentFragment"
).
commit
();
}
List
<
ApiObject
>
rowListItem
=
getAllItemList
();
lLayout
=
new
GridLayoutManager
(
MainActivity
.
this
,
4
);
RecyclerView
rView
=
(
RecyclerView
)
findViewById
(
R
.
id
.
recycler_view
);
rView
.
setHasFixedSize
(
true
);
rView
.
setLayoutManager
(
lLayout
);
RecyclerViewAdapter
rcAdapter
=
new
RecyclerViewAdapter
(
MainActivity
.
this
,
rowListItem
);
rView
.
setAdapter
(
rcAdapter
);
}
private
List
<
ApiObject
>
getAllItemList
(){
List
<
ApiObject
>
allItems
=
new
ArrayList
<
ApiObject
>();
allItems
.
add
(
new
ApiObject
(
"Kina"
,
R
.
drawable
.
cinema512
));
allItems
.
add
(
new
ApiObject
(
"Wypadki drogowe"
,
R
.
drawable
.
invert512
));
allItems
.
add
(
new
ApiObject
(
"Kina"
,
R
.
drawable
.
cinema512
));
allItems
.
add
(
new
ApiObject
(
"Wypadki drogowe"
,
R
.
drawable
.
invert512
));
allItems
.
add
(
new
ApiObject
(
"Kina"
,
R
.
drawable
.
cinema512
));
allItems
.
add
(
new
ApiObject
(
"Wypadki drogowe"
,
R
.
drawable
.
invert512
));
allItems
.
add
(
new
ApiObject
(
"Kina"
,
R
.
drawable
.
cinema512
));
allItems
.
add
(
new
ApiObject
(
"Wypadki drogowe"
,
R
.
drawable
.
invert512
));
allItems
.
add
(
new
ApiObject
(
"Kina"
,
R
.
drawable
.
cinema512
));
allItems
.
add
(
new
ApiObject
(
"Wypadki drogowe"
,
R
.
drawable
.
invert512
));
allItems
.
add
(
new
ApiObject
(
"Kina"
,
R
.
drawable
.
cinema512
));
allItems
.
add
(
new
ApiObject
(
"Wypadki drogowe"
,
R
.
drawable
.
invert512
));
allItems
.
add
(
new
ApiObject
(
"Kina"
,
R
.
drawable
.
cinema512
));
allItems
.
add
(
new
ApiObject
(
"Wypadki drogowe"
,
R
.
drawable
.
invert512
));
allItems
.
add
(
new
ApiObject
(
"Kina"
,
R
.
drawable
.
cinema512
));
allItems
.
add
(
new
ApiObject
(
"Wypadki drogowe"
,
R
.
drawable
.
invert512
));
return
allItems
;
}
@Override
...
...
@@ -36,7 +96,6 @@ public class MainActivity extends AppCompatActivity {
}
private
boolean
isLoggedIn
()
{
SharedPreferences
sharedPreferences
=
getSharedPreferences
(
"JoinTheCityPreferences"
,
Context
.
MODE_PRIVATE
);
return
!
sharedPreferences
.
getString
(
"token"
,
""
).
isEmpty
();
}
...
...
@@ -54,8 +113,15 @@ public class MainActivity extends AppCompatActivity {
// as you specify a parent activity in AndroidManifest.xml.
int
id
=
item
.
getItemId
();
//noinspection SimplifiableIfStatement
if
(
id
==
R
.
id
.
action_settings
)
{
if
(
id
==
R
.
id
.
map_view
)
{
Intent
intent
=
new
Intent
(
this
,
MapsActivity
.
class
);
startActivity
(
intent
);
return
true
;
}
if
(
id
==
R
.
id
.
friends
)
{
Intent
intent
=
new
Intent
(
this
,
FriendsActivity
.
class
);
startActivity
(
intent
);
return
true
;
}
...
...
JoinTheCityAPP/app/src/main/java/anotherlineofcode/com/jointhecityapp/MainContentFragment.java
0 → 100644
View file @
babaa230
package
anotherlineofcode
.
com
.
jointhecityapp
;
import
android.os.Bundle
;
import
android.app.Fragment
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
/**
* A simple {@link Fragment} subclass.
*/
public
class
MainContentFragment
extends
Fragment
{
public
MainContentFragment
()
{
// Required empty public constructor
}
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
// Inflate the layout for this fragment
View
view
=
inflater
.
inflate
(
R
.
layout
.
fragment_main_content
,
container
,
false
);
return
view
;
}
}
JoinTheCityAPP/app/src/main/java/anotherlineofcode/com/jointhecityapp/MapsActivity.java
0 → 100644
View file @
babaa230
package
anotherlineofcode
.
com
.
jointhecityapp
;
import
android.content.Context
;
import
android.content.SharedPreferences
;
import
android.support.v4.app.FragmentActivity
;
import
android.os.Bundle
;
import
com.google.android.gms.maps.CameraUpdateFactory
;
import
com.google.android.gms.maps.GoogleMap
;
import
com.google.android.gms.maps.OnMapReadyCallback
;
import
com.google.android.gms.maps.SupportMapFragment
;
import
com.google.android.gms.maps.model.LatLng
;
import
com.google.android.gms.maps.model.MarkerOptions
;
public
class
MapsActivity
extends
FragmentActivity
implements
OnMapReadyCallback
{
private
GoogleMap
mMap
;
private
SharedPreferences
sharedPreferences
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_maps
);
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
SupportMapFragment
mapFragment
=
(
SupportMapFragment
)
getSupportFragmentManager
()
.
findFragmentById
(
R
.
id
.
map
);
mapFragment
.
getMapAsync
(
this
);
}
/**
* Manipulates the map once available.
* This callback is triggered when the map is ready to be used.
* This is where we can add markers or lines, add listeners or move the camera. In this case,
* we just add a marker near Sydney, Australia.
* If Google Play services is not installed on the device, the user will be prompted to install
* it inside the SupportMapFragment. This method will only be triggered once the user has
* installed Google Play services and returned to the app.
*/
@Override
public
void
onMapReady
(
GoogleMap
googleMap
)
{
mMap
=
googleMap
;
sharedPreferences
=
getSharedPreferences
(
"JoinTheCityPreferences"
,
Context
.
MODE_PRIVATE
);
int
lat
=
sharedPreferences
.
getInt
(
"lat"
,
0
);
int
lng
=
sharedPreferences
.
getInt
(
"lng"
,
0
);
LatLng
camera
=
new
LatLng
(
lat
,
lng
);
// // Add a marker in Sydney and move the camera
// LatLng sydney = new LatLng(lat, lng);
// mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
mMap
.
moveCamera
(
CameraUpdateFactory
.
newLatLng
(
camera
));
}
}
JoinTheCityAPP/app/src/main/java/anotherlineofcode/com/jointhecityapp/RecyclerViewAdapter.java
0 → 100644
View file @
babaa230
package
anotherlineofcode
.
com
.
jointhecityapp
;
import
android.content.Context
;
import
android.support.v7.widget.RecyclerView
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
java.util.List
;
public
class
RecyclerViewAdapter
extends
RecyclerView
.
Adapter
<
RecyclerViewHolders
>
{
private
List
<
ApiObject
>
itemList
;
private
Context
context
;
public
RecyclerViewAdapter
(
Context
context
,
List
<
ApiObject
>
itemList
)
{
this
.
itemList
=
itemList
;
this
.
context
=
context
;
}
@Override
public
RecyclerViewHolders
onCreateViewHolder
(
ViewGroup
parent
,
int
viewType
)
{
View
layoutView
=
LayoutInflater
.
from
(
parent
.
getContext
()).
inflate
(
R
.
layout
.
card_view_list
,
null
);
RecyclerViewHolders
rcv
=
new
RecyclerViewHolders
(
layoutView
);
return
rcv
;
}
@Override
public
void
onBindViewHolder
(
RecyclerViewHolders
holder
,
int
position
)
{
holder
.
countryName
.
setText
(
itemList
.
get
(
position
).
getName
());
holder
.
countryPhoto
.
setImageResource
(
itemList
.
get
(
position
).
getPhoto
());
}
@Override
public
int
getItemCount
()
{
return
this
.
itemList
.
size
();
}
}
JoinTheCityAPP/app/src/main/java/anotherlineofcode/com/jointhecityapp/RecyclerViewHolders.java
0 → 100644
View file @
babaa230
package
anotherlineofcode
.
com
.
jointhecityapp
;
import
android.support.v7.widget.RecyclerView
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
android.widget.Toast
;
public
class
RecyclerViewHolders
extends
RecyclerView
.
ViewHolder
implements
View
.
OnClickListener
{
public
TextView
countryName
;
public
ImageView
countryPhoto
;
public
RecyclerViewHolders
(
View
itemView
)
{
super
(
itemView
);
itemView
.
setOnClickListener
(
this
);
countryName
=
(
TextView
)
itemView
.
findViewById
(
R
.
id
.
country_name
);
countryPhoto
=
(
ImageView
)
itemView
.
findViewById
(
R
.
id
.
country_photo
);
}
@Override
public
void
onClick
(
View
view
)
{
Toast
.
makeText
(
view
.
getContext
(),
"Clicked position = "
+
getPosition
(),
Toast
.
LENGTH_SHORT
).
show
();
}
}
JoinTheCityAPP/app/src/main/res/drawable/cinema512.png
0 → 100644
View file @
babaa230
29.8 KB
JoinTheCityAPP/app/src/main/res/drawable/invert512.png
0 → 100644
View file @
babaa230
27.6 KB
JoinTheCityAPP/app/src/main/res/layout/activity_friends.xml
0 → 100644
View file @
babaa230
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:fitsSystemWindows=
"true"
tools:context=
"anotherlineofcode.com.jointhecityapp.FriendsActivity"
>
<android.support.design.widget.AppBarLayout
android:layout_height=
"wrap_content"
android:layout_width=
"match_parent"
android:theme=
"@style/AppBarOverlay"
>
<android.support.v7.widget.Toolbar
android:id=
"@+id/toolbar"
android:layout_width=
"match_parent"
android:layout_height=
"?attr/actionBarSize"
android:background=
"?attr/colorPrimary"
app:popupTheme=
"@style/PopupOverlay"
/>
</android.support.design.widget.AppBarLayout>
<include
layout=
"@layout/content_friends"
/>
<android.support.design.widget.FloatingActionButton
android:id=
"@+id/fab"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"bottom|end"
android:layout_margin=
"@dimen/fab_margin"
android:src=
"@android:drawable/ic_dialog_email"
/>
</android.support.design.widget.CoordinatorLayout>
JoinTheCityAPP/app/src/main/res/layout/activity_main.xml
View file @
babaa230
<
Relative
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
Linear
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:paddingLeft=
"@dimen/activity_horizontal_margin"
android:paddingRight=
"@dimen/activity_horizontal_margin"
android:paddingTop=
"@dimen/activity_vertical_margin"
android:paddingBottom=
"@dimen/activity_vertical_margin"
tools:context=
".MainActivity"
>
android:paddingBottom=
"@dimen/activity_vertical_margin"
android:orientation=
"vertical"
tools:context=
".MainActivity"
>
<TextView
android:text=
"@string/hello_world"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/recycler_view"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:scrollbars=
"vertical"
/>
</RelativeLayout>
<FrameLayout
android:id=
"@+id/content"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
>
</FrameLayout>
</LinearLayout>
JoinTheCityAPP/app/src/main/res/layout/activity_maps.xml
0 → 100644
View file @
babaa230
<fragment
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:map=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:id=
"@+id/map"
tools:context=
"anotherlineofcode.com.jointhecityapp.MapsActivity"
android:name=
"com.google.android.gms.maps.SupportMapFragment"
/>
JoinTheCityAPP/app/src/main/res/layout/card_view_list.xml
0 → 100644
View file @
babaa230
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
xmlns:card_view=
"http://schemas.android.com/apk/res-auto"
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/card_view"
android:layout_width=
"80dp"
android:layout_height=
"wrap_content"
card_view:cardUseCompatPadding=
"true"
card_view:cardCornerRadius=
"8dp"
android:layout_marginBottom=
"16dp"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<ImageView
android:id=
"@+id/country_photo"
android:layout_width=
"50dp"
android:layout_height=
"50dp"
android:layout_centerHorizontal=
"true"
android:padding=
"5dp"
android:contentDescription=
"@string/action_settings"
android:src=
"@drawable/common_google_signin_btn_icon_dark_normal"
android:scaleType=
"centerCrop"
/>
<TextView
android:id=
"@+id/country_name"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:textSize=
"13sp"
android:text=
"Description"
android:gravity=
"center"
android:layout_below=
"@+id/country_photo"
android:paddingBottom=
"4dp"
android:paddingTop=
"4dp"
android:layout_alignParentBottom=
"true"
android:background=
"@color/common_plus_signin_btn_text_dark_default"
/>
</RelativeLayout>
</android.support.v7.widget.CardView>
\ No newline at end of file
JoinTheCityAPP/app/src/main/res/layout/content_friends.xml
0 → 100644
View file @
babaa230
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:paddingLeft=
"@dimen/activity_horizontal_margin"
android:paddingRight=
"@dimen/activity_horizontal_margin"
android:paddingTop=
"@dimen/activity_vertical_margin"
android:paddingBottom=
"@dimen/activity_vertical_margin"
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
tools:showIn=
"@layout/activity_friends"
tools:context=
"anotherlineofcode.com.jointhecityapp.FriendsActivity"
>
</RelativeLayout>
JoinTheCityAPP/app/src/main/res/layout/fragment_main_content.xml
0 → 100644
View file @
babaa230
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
"anotherlineofcode.com.jointhecityapp.MainContentFragment"
>
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:text=
"@string/hello_blank_fragment"
/>
</FrameLayout>
JoinTheCityAPP/app/src/main/res/layout/fragment_map.xml
0 → 100644
View file @
babaa230
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
"anotherlineofcode.com.jointhecityapp.MapFragment"
>
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:text=
"@string/hello_blank_fragment"
/>
</FrameLayout>
JoinTheCityAPP/app/src/main/res/menu/menu_main.xml
View file @
babaa230
<menu
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
tools:context=
".MainActivity"
>
<item
android:id=
"@+id/action_settings"
android:title=
"@string/action_settings"
android:orderInCategory=
"100"
app:showAsAction=
"never"
/>
<item
android:id=
"@+id/api_list"
android:icon=
"@drawable/ic_launcher"
android:title=
"Lista API"
app:showAsAction=
"always"
/>
<item
android:id=
"@+id/friends"
android:icon=
"@drawable/ic_launcher"
android:title=
"Znajomi"
app:showAsAction=
"always"
/>
<item
android:id=
"@+id/messages"
android:icon=
"@drawable/ic_launcher"
android:title=
"Wiadomości"
app:showAsAction=
"always"
/>
<item
android:id=
"@+id/map_view"
android:icon=
"@drawable/ic_launcher"
android:title=
"Mapa"
app:showAsAction=
"always"
/>
<item
android:id=
"@+id/logo"
android:icon=
"@drawable/ic_launcher"
android:title=
"Logo"
app:showAsAction=
"always"
/>
</menu>
JoinTheCityAPP/app/src/main/res/values-v21/styles.xml
0 → 100644
View file @
babaa230
<resources>
>
</resources>
JoinTheCityAPP/app/src/main/res/values/dimens.xml
View file @
babaa230
...
...
@@ -2,4 +2,5 @@
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen
name=
"activity_horizontal_margin"
>
16dp
</dimen>
<dimen
name=
"activity_vertical_margin"
>
16dp
</dimen>
<dimen
name=
"fab_margin"
>
16dp
</dimen>
</resources>
JoinTheCityAPP/app/src/main/res/values/strings.xml
View file @
babaa230
...
...
@@ -9,4 +9,9 @@
<string
name=
"api_url"
>
http://jointhecity.telemabk.pl/
</string>
<string
name=
"action_sign_in"
>
Zaloguj się
</string>
<!-- TODO: Remove or change this placeholder text -->
<string
name=
"hello_blank_fragment"
>
Hello blank fragment
</string>
<string
name=
"title_activity_maps"
>
Map
</string>
<string
name=
"title_activity_friends"
>
FriendsActivity
</string>
</resources>
JoinTheCityAPP/app/src/main/res/values/styles.xml
View file @
babaa230
...
...
@@ -4,5 +4,7 @@
<style
name=
"AppTheme"
parent=
"Theme.AppCompat.Light.DarkActionBar"
>
<!-- Customize your theme here. -->
</style>
<style
name=
"AppBarOverlay"
parent=
"ThemeOverlay.AppCompat.Dark.ActionBar"
/>
<style
name=
"PopupOverlay"
parent=
"ThemeOverlay.AppCompat.Light"
/>
</resources>
JoinTheCityAPP/app/src/release/res/values/google_maps_api.xml
0 → 100644
View file @
babaa230
<resources>
<!--
TODO: Before you run your application, you need a Google Maps API key.
To get one, follow this link, follow the directions and press "Create" at the end:
https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=25:22:9C:09:F0:8F:2C:87:22:4E:8E:75:BA:C7:3B:C4:C0:D5:4E:AF%3Banotherlineofcode.com.jointhecityapp
You can also add your credentials to an existing key, using this line:
25:22:9C:09:F0:8F:2C:87:22:4E:8E:75:BA:C7:3B:C4:C0:D5:4E:AF;anotherlineofcode.com.jointhecityapp
Alternatively, follow the directions here:
https://developers.google.com/maps/documentation/android/start#get-key
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
string in this file.
-->
<string
name=
"google_maps_key"
translatable=
"false"
templateMergeStrategy=
"preserve"
>
YOUR_KEY_HERE
</string>
</resources>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment