Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
linenive committed Jun 20, 2021
2 parents 13100d2 + 13c5f21 commit 8a06eb9
Show file tree
Hide file tree
Showing 9 changed files with 223 additions and 180 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

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

Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class AddArticleActivity : AppCompatActivity() {
val articleTitle = binding.titleEditText.text.toString()
val articleContent = binding.contentEditText.text.toString()
val recruitmentNumberText = binding.recruitmentNumberEditText.text.toString()
val recruitmentNumber = recruitmentNumberText.toInt()


if (articleTitle.isEmpty()) {
Toast.makeText(this, "글의 제목을 입력해주세요.", Toast.LENGTH_SHORT).show()
Expand All @@ -187,6 +187,7 @@ class AddArticleActivity : AppCompatActivity() {

showProgress()

val recruitmentNumber = recruitmentNumberText.toInt()
//중간에 이미지가 있으면 업로드 과정을 추가
selectedUriList = imageAdapter.getUriList()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import android.view.MenuItem
import android.view.View
import android.widget.EditText
import android.widget.LinearLayout
import android.widget.ScrollView
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.isVisible
Expand Down Expand Up @@ -304,8 +305,25 @@ class ArticleActivity : AppCompatActivity() {
writerId = articleModel.writerId
articleTitle = articleModel.articleTitle
if (articleModel.articleImageUrl.isEmpty()) {
binding.photoImageRecyclerView.visibility = View.INVISIBLE
val scrollParams = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
0,
9.0f
)
binding.contentScrollView.layoutParams = scrollParams
binding.contentScrollView.scrollBarFadeDuration = 0
binding.contentScrollView.isAlwaysDrawnWithCacheEnabled = true
binding.photoImageRecyclerView.visibility = View.GONE

} else {
val scrollParams = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
0,
6.0f
)
binding.contentScrollView.layoutParams = scrollParams
binding.photoImageRecyclerView.visibility = View.VISIBLE

fileNameList = articleModel.articleImageFileName
initImageRecyclerView()
for (uri in articleModel.articleImageUrl) {
Expand Down
114 changes: 60 additions & 54 deletions app/src/main/res/layout/activity_add_article.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,41 +60,39 @@
android:layout_height="1dp"
android:background="@color/gray_cc" />

<LinearLayout
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:layout_height="0dp"
android:layout_weight="5.5">

<EditText
android:id="@+id/titleEditText"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:paddingTop="8dp"
android:layout_marginHorizontal="16dp"
android:paddingHorizontal="16dp"
android:background="@android:color/transparent"
android:hint="@string/input_title"
tools:ignore="RtlSymmetry" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/tagRecyclerView"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="16dp" />
android:orientation="vertical">

<View
android:id="@+id/TitleEditTextUnderLineView"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray_cc" />
<EditText
android:id="@+id/titleEditText"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:paddingVertical="8dp"
android:layout_marginHorizontal="16dp"
android:background="@android:color/transparent"
android:hint="@string/input_title"
tools:ignore="RtlSymmetry" />

<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="6"
android:layout_marginHorizontal="16dp" >
<View
android:id="@+id/TitleEditTextUnderLineView"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray_cc" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/tagRecyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="16dp" />

<EditText
android:id="@+id/contentEditText"
Expand All @@ -103,37 +101,44 @@
android:padding="16dp"
android:background="@android:color/transparent"
android:hint="@string/input_content"
android:lines="12"
android:gravity="top"
android:inputType="textMultiLine" />

</androidx.core.widget.NestedScrollView>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/imageRecyclerView"
android:layout_width="match_parent"
android:layout_height="110dp"
android:layout_marginStart="8dp"
android:layout_marginVertical="8dp"
android:orientation="horizontal"
android:visibility="gone"/>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/recruitmentNumberLayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.1"
android:layout_marginHorizontal="16dp"
android:layout_marginVertical="10dp">

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/imageRecyclerView"
android:layout_width="match_parent"
android:layout_height="110dp"
android:layout_marginStart="8dp"
android:layout_marginVertical="8dp"
android:orientation="horizontal"
android:visibility="gone"/>
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/recruitmentNumberEditText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:hint="모집인원"
android:inputType="number" />

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/recruitmentNumberLayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.1"
android:layout_marginHorizontal="16dp"
android:layout_marginVertical="10dp">
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/recruitmentNumberEditText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:hint="모집인원"
android:inputType="number" />
</LinearLayout>

</com.google.android.material.textfield.TextInputLayout>
</androidx.core.widget.NestedScrollView>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical">

<LinearLayout
android:id="@+id/locationInfoLayout"
Expand All @@ -142,7 +147,8 @@
android:layout_weight="1"
android:paddingStart="10dp"
android:orientation="horizontal"
android:background="@drawable/borderline_top_bottom" >
android:background="@drawable/borderline_top_bottom"
tools:ignore="NestedWeights,RtlSymmetry">

<ImageView
android:layout_width="0dp"
Expand Down
134 changes: 71 additions & 63 deletions app/src/main/res/layout/activity_article.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,79 +135,87 @@

</FrameLayout>

<LinearLayout
android:id="@+id/locationInfoLayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.2"
android:orientation="horizontal"
android:background="@drawable/borderline_top_bottom">

<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:src="@drawable/ic_baseline_location_24"
android:layout_gravity="center"
android:layout_marginStart="6dp"
android:padding="10dp" />

<TextView
android:id="@+id/locationTextView"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4"
android:gravity="center_vertical"
android:padding="16dp"
android:text="@string/location"
android:textSize="14sp"/>

<Button
android:id="@+id/showMapButton"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:layout_gravity="center"
android:layout_margin="6dp"
android:fontFamily="@font/font"
android:text="지도 보기"/>

</LinearLayout>

<ScrollView
android:id="@+id/contentScrollView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="4.8">
android:layout_weight="9">

<TextView
android:layout_marginTop="16dp"
android:id="@+id/contentTextView"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:paddingVertical="16dp"
android:textSize="16sp"
android:lines="12"
android:gravity="top"
android:hint="@string/content" />
android:orientation="vertical">

</ScrollView>
<LinearLayout
android:id="@+id/locationInfoLayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.2"
android:orientation="horizontal"
android:background="@drawable/borderline_top_bottom">

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/tagRecyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="16dp" />
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:src="@drawable/ic_baseline_location_24"
android:layout_gravity="center"
android:layout_marginStart="6dp"
android:padding="10dp"
tools:ignore="NestedWeights" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/photoImageRecyclerView"
android:layout_width="match_parent"
android:layout_height="140dp"
android:layout_gravity="center"
android:orientation="horizontal" >
<TextView
android:id="@+id/locationTextView"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4"
android:gravity="center_vertical"
android:padding="16dp"
android:text="@string/location"
android:textSize="14sp"/>

<Button
android:id="@+id/showMapButton"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:layout_gravity="center"
android:layout_margin="6dp"
android:fontFamily="@font/font"
android:text="지도 보기"/>

</LinearLayout>

<TextView
android:layout_marginTop="16dp"
android:id="@+id/contentTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:paddingVertical="16dp"
android:textSize="16sp"
android:gravity="top"
android:hint="@string/content" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/tagRecyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="16dp" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/photoImageRecyclerView"
android:layout_width="match_parent"
android:layout_height="140dp"
android:layout_gravity="center"
android:orientation="horizontal"
android:visibility="gone">

</androidx.recyclerview.widget.RecyclerView>

</androidx.recyclerview.widget.RecyclerView>
</LinearLayout>
</ScrollView>

<Button
android:id="@+id/contactButton"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/layout/activity_check_map.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@
android:layout_height="wrap_content"
android:src="@drawable/ic_my_location"
app:layout_constraintEnd_toEndOf="parent"
android:backgroundTint="@color/colorMain"
app:layout_constraintBottom_toBottomOf="@id/mapFragment"
android:layout_marginEnd="32dp"
android:layout_marginBottom="32dp"
app:borderWidth="0dp"
android:contentDescription="현재 위치" />

</androidx.constraintlayout.widget.ConstraintLayout>
Loading

0 comments on commit 8a06eb9

Please sign in to comment.