Toggle navigation
Toggle navigation
This project
Loading...
Sign in
손장민
/
FirebaseAuth
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
손장민
2017-10-19 21:26:42 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0f91161f56d4222529a72faf052656a4e39b2f91
0f91161f
1 parent
37256674
nothing
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
259 additions
and
21 deletions
.idea/codeStyleSettings.xml
app/src/main/java/com/example/user/firebaseauthdemo/Community.java
.idea/codeStyleSettings.xml
0 → 100644
View file @
0f91161
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectCodeStyleSettingsManager"
>
<option
name=
"PER_PROJECT_SETTINGS"
>
<value>
<option
name=
"CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND"
value=
"99"
/>
<option
name=
"NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND"
value=
"99"
/>
<option
name=
"PACKAGES_TO_USE_IMPORT_ON_DEMAND"
>
<value
/>
</option>
<option
name=
"IMPORT_LAYOUT_TABLE"
>
<value>
<package
name=
"android"
withSubpackages=
"true"
static=
"false"
/>
<emptyLine
/>
<package
name=
"com"
withSubpackages=
"true"
static=
"false"
/>
<emptyLine
/>
<package
name=
"junit"
withSubpackages=
"true"
static=
"false"
/>
<emptyLine
/>
<package
name=
"net"
withSubpackages=
"true"
static=
"false"
/>
<emptyLine
/>
<package
name=
"org"
withSubpackages=
"true"
static=
"false"
/>
<emptyLine
/>
<package
name=
"java"
withSubpackages=
"true"
static=
"false"
/>
<emptyLine
/>
<package
name=
"javax"
withSubpackages=
"true"
static=
"false"
/>
<emptyLine
/>
<package
name=
""
withSubpackages=
"true"
static=
"false"
/>
<emptyLine
/>
<package
name=
""
withSubpackages=
"true"
static=
"true"
/>
<emptyLine
/>
</value>
</option>
<option
name=
"RIGHT_MARGIN"
value=
"100"
/>
<AndroidXmlCodeStyleSettings>
<option
name=
"USE_CUSTOM_SETTINGS"
value=
"true"
/>
</AndroidXmlCodeStyleSettings>
<Objective-C-extensions>
<file>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Import"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Macro"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Typedef"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Enum"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Constant"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Global"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Struct"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"FunctionPredecl"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Function"
/>
</file>
<class>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Property"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Synthesize"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"InitMethod"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"StaticMethod"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"InstanceMethod"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"DeallocMethod"
/>
</class>
<extensions>
<pair
source=
"cpp"
header=
"h"
/>
<pair
source=
"c"
header=
"h"
/>
</extensions>
</Objective-C-extensions>
<XML>
<option
name=
"XML_KEEP_LINE_BREAKS"
value=
"false"
/>
<option
name=
"XML_ALIGN_ATTRIBUTES"
value=
"false"
/>
<option
name=
"XML_SPACE_INSIDE_EMPTY_TAG"
value=
"true"
/>
</XML>
<codeStyleSettings
language=
"XML"
>
<option
name=
"FORCE_REARRANGE_MODE"
value=
"1"
/>
<indentOptions>
<option
name=
"CONTINUATION_INDENT_SIZE"
value=
"4"
/>
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>
xmlns:android
</NAME>
<XML_NAMESPACE>
^$
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
xmlns:.*
</NAME>
<XML_NAMESPACE>
^$
</XML_NAMESPACE>
</AND>
</match>
<order>
BY_NAME
</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:id
</NAME>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:name
</NAME>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
name
</NAME>
<XML_NAMESPACE>
^$
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
style
</NAME>
<XML_NAMESPACE>
^$
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*
</NAME>
<XML_NAMESPACE>
^$
</XML_NAMESPACE>
</AND>
</match>
<order>
BY_NAME
</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:layout_width
</NAME>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:layout_height
</NAME>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:layout_.*
</NAME>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
<order>
BY_NAME
</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:width
</NAME>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
<order>
BY_NAME
</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:height
</NAME>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
<order>
BY_NAME
</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*
</NAME>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
<order>
BY_NAME
</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*
</NAME>
<XML_NAMESPACE>
.*
</XML_NAMESPACE>
</AND>
</match>
<order>
BY_NAME
</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
</value>
</option>
<option
name=
"PREFERRED_PROJECT_CODE_STYLE"
value=
"Default (1)"
/>
</component>
</project>
\ No newline at end of file
app/src/main/java/com/example/user/firebaseauthdemo/Community.java
View file @
0f91161
...
...
@@ -25,7 +25,8 @@ import com.squareup.picasso.Picasso;
* Created by HYB on 2017. 10. 11..
*/
public
class
Community
extends
Fragment
{
public
class
Community
extends
Fragment
{
private
RecyclerView
mBlogList
;
private
RecyclerView
.
LayoutManager
layoutManager
;
...
...
@@ -33,7 +34,8 @@ public class Community extends Fragment {
@Nullable
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
Bundle
savedInstanceState
)
{
public
View
onCreateView
(
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
Bundle
savedInstanceState
)
{
setHasOptionsMenu
(
true
);
View
view
=
inflater
.
inflate
(
R
.
layout
.
community
,
container
,
false
);
...
...
@@ -48,18 +50,17 @@ public class Community extends Fragment {
}
@Override
public
void
onStart
()
{
public
void
onStart
()
{
super
.
onStart
();
FirebaseRecyclerAdapter
<
Blog
,
BlogViewHolder
>
firebaseRecyclerAdapter
=
new
FirebaseRecyclerAdapter
<
Blog
,
BlogViewHolder
>(
Blog
.
class
,
R
.
layout
.
blog_row
,
BlogViewHolder
.
class
,
mDatabase
)
{
Blog
.
class
,
R
.
layout
.
blog_row
,
BlogViewHolder
.
class
,
mDatabase
)
{
@Override
protected
void
populateViewHolder
(
BlogViewHolder
viewHolder
,
Blog
model
,
int
position
)
{
protected
void
populateViewHolder
(
BlogViewHolder
viewHolder
,
Blog
model
,
int
position
)
{
viewHolder
.
setTitle
(
model
.
getTitle
());
viewHolder
.
setDesc
(
model
.
getDesc
());
viewHolder
.
setImage
(
getActivity
().
getApplicationContext
(),
model
.
getImage
());
...
...
@@ -68,19 +69,23 @@ public class Community extends Fragment {
mBlogList
.
setAdapter
(
firebaseRecyclerAdapter
);
}
public
static
class
BlogViewHolder
extends
RecyclerView
.
ViewHolder
{
public
static
class
BlogViewHolder
extends
RecyclerView
.
ViewHolder
{
View
mView
;
public
BlogViewHolder
(
View
itemView
)
{
public
BlogViewHolder
(
View
itemView
)
{
super
(
itemView
);
mView
=
itemView
;
}
public
void
setTitle
(
String
title
){
public
void
setTitle
(
String
title
)
{
TextView
post_title
=
(
TextView
)
mView
.
findViewById
(
R
.
id
.
post_title
);
if
(
title
.
length
()>
30
)
if
(
title
.
length
()
>
30
)
{
post_title
.
setText
(
title
.
substring
(
0
,
30
));
post_title
.
setText
(
title
.
substring
(
0
,
30
));
}
else
{
...
...
@@ -88,11 +93,12 @@ public class Community extends Fragment {
}
}
public
void
setDesc
(
String
desc
){
public
void
setDesc
(
String
desc
)
{
TextView
post_desc
=
(
TextView
)
mView
.
findViewById
(
R
.
id
.
post_desc
);
if
(
desc
.
length
()>
50
)
if
(
desc
.
length
()
>
50
)
{
post_desc
.
setText
(
desc
.
substring
(
0
,
50
));
post_desc
.
setText
(
desc
.
substring
(
0
,
50
));
}
else
{
...
...
@@ -100,7 +106,8 @@ public class Community extends Fragment {
}
}
public
void
setImage
(
Context
ctx
,
String
image
){
public
void
setImage
(
Context
ctx
,
String
image
)
{
ImageView
post_image
=
(
ImageView
)
mView
.
findViewById
(
R
.
id
.
post_image
);
Picasso
.
with
(
ctx
).
load
(
image
).
into
(
post_image
);
...
...
@@ -109,16 +116,19 @@ public class Community extends Fragment {
}
@Override
public
void
onCreateOptionsMenu
(
Menu
menu
,
MenuInflater
inflater
)
{
public
void
onCreateOptionsMenu
(
Menu
menu
,
MenuInflater
inflater
)
{
inflater
.
inflate
(
R
.
menu
.
community_menu
,
menu
);
super
.
onCreateOptionsMenu
(
menu
,
inflater
);
}
@Override
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
if
(
item
.
getItemId
()
==
R
.
id
.
action_add
){
if
(
item
.
getItemId
()
==
R
.
id
.
action_add
)
{
Intent
intent
=
new
Intent
(
getActivity
(),
PostActivity
.
class
);
startActivity
(
intent
);
}
...
...
Please
register
or
login
to post a comment