WIP visor de dicusiones, pantalla de perfil
This commit is contained in:
parent
72290eb50f
commit
7f6f96a005
4
.idea/assetWizardSettings.xml
generated
4
.idea/assetWizardSettings.xml
generated
@ -18,7 +18,7 @@
|
|||||||
<PersistentState>
|
<PersistentState>
|
||||||
<option name="values">
|
<option name="values">
|
||||||
<map>
|
<map>
|
||||||
<entry key="url" value="file:/$USER_HOME$/AppData/Local/Android/Sdk/icons/material/materialicons/image/baseline_image_24.xml" />
|
<entry key="url" value="file:/$USER_HOME$/AppData/Local/Android/Sdk/icons/material/materialicons/pending/baseline_pending_24.xml" />
|
||||||
</map>
|
</map>
|
||||||
</option>
|
</option>
|
||||||
</PersistentState>
|
</PersistentState>
|
||||||
@ -28,7 +28,7 @@
|
|||||||
</option>
|
</option>
|
||||||
<option name="values">
|
<option name="values">
|
||||||
<map>
|
<map>
|
||||||
<entry key="outputName" value="baseline_image_24" />
|
<entry key="outputName" value="baseline_pending_24" />
|
||||||
<entry key="sourceFile" value="C:\Users\erike\C:\Users\erike\Downloads\comments-solid.svg" />
|
<entry key="sourceFile" value="C:\Users\erike\C:\Users\erike\Downloads\comments-solid.svg" />
|
||||||
</map>
|
</map>
|
||||||
</option>
|
</option>
|
||||||
|
|||||||
18
.idea/navEditor.xml
generated
18
.idea/navEditor.xml
generated
@ -84,6 +84,18 @@
|
|||||||
</LayoutPositions>
|
</LayoutPositions>
|
||||||
</value>
|
</value>
|
||||||
</entry>
|
</entry>
|
||||||
|
<entry key="postViewerActivity">
|
||||||
|
<value>
|
||||||
|
<LayoutPositions>
|
||||||
|
<option name="myPosition">
|
||||||
|
<Point>
|
||||||
|
<option name="x" value="-520" />
|
||||||
|
<option name="y" value="-373" />
|
||||||
|
</Point>
|
||||||
|
</option>
|
||||||
|
</LayoutPositions>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
<entry key="profileActivity">
|
<entry key="profileActivity">
|
||||||
<value>
|
<value>
|
||||||
<LayoutPositions>
|
<LayoutPositions>
|
||||||
@ -96,13 +108,13 @@
|
|||||||
</LayoutPositions>
|
</LayoutPositions>
|
||||||
</value>
|
</value>
|
||||||
</entry>
|
</entry>
|
||||||
<entry key="searchFragment2">
|
<entry key="searchFragment">
|
||||||
<value>
|
<value>
|
||||||
<LayoutPositions>
|
<LayoutPositions>
|
||||||
<option name="myPosition">
|
<option name="myPosition">
|
||||||
<Point>
|
<Point>
|
||||||
<option name="x" value="-281" />
|
<option name="x" value="12" />
|
||||||
<option name="y" value="221" />
|
<option name="y" value="12" />
|
||||||
</Point>
|
</Point>
|
||||||
</option>
|
</option>
|
||||||
</LayoutPositions>
|
</LayoutPositions>
|
||||||
|
|||||||
@ -28,6 +28,7 @@
|
|||||||
<activity android:name=".profile.ui.ProfileActivity" android:theme="@style/Theme.Isolaatti"/>
|
<activity android:name=".profile.ui.ProfileActivity" android:theme="@style/Theme.Isolaatti"/>
|
||||||
<activity android:name=".settings.ui.SettingsActivity" android:theme="@style/Theme.Isolaatti"/>
|
<activity android:name=".settings.ui.SettingsActivity" android:theme="@style/Theme.Isolaatti"/>
|
||||||
<activity android:name=".posting.posts.ui.CreatePostActivity" android:theme="@style/Theme.Isolaatti" android:windowSoftInputMode="adjustResize"/>
|
<activity android:name=".posting.posts.ui.CreatePostActivity" android:theme="@style/Theme.Isolaatti" android:windowSoftInputMode="adjustResize"/>
|
||||||
|
<activity android:name=".posting.PostViewerActivity" android:theme="@style/Theme.Isolaatti"/>
|
||||||
</application>
|
</application>
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
</manifest>
|
</manifest>
|
||||||
@ -21,6 +21,7 @@ import com.isolaatti.R
|
|||||||
import com.isolaatti.common.ErrorMessageViewModel
|
import com.isolaatti.common.ErrorMessageViewModel
|
||||||
import com.isolaatti.databinding.FragmentFeedBinding
|
import com.isolaatti.databinding.FragmentFeedBinding
|
||||||
import com.isolaatti.home.presentation.FeedViewModel
|
import com.isolaatti.home.presentation.FeedViewModel
|
||||||
|
import com.isolaatti.posting.PostViewerActivity
|
||||||
import com.isolaatti.posting.posts.presentation.PostsViewModel
|
import com.isolaatti.posting.posts.presentation.PostsViewModel
|
||||||
import com.isolaatti.posting.comments.presentation.BottomSheetPostComments
|
import com.isolaatti.posting.comments.presentation.BottomSheetPostComments
|
||||||
import com.isolaatti.posting.common.domain.OnUserInteractedWithPostCallback
|
import com.isolaatti.posting.common.domain.OnUserInteractedWithPostCallback
|
||||||
@ -195,8 +196,12 @@ class FeedFragment : Fragment(), OnUserInteractedWithPostCallback {
|
|||||||
modalBottomSheet.show(requireActivity().supportFragmentManager, BottomSheetPostComments.TAG)
|
modalBottomSheet.show(requireActivity().supportFragmentManager, BottomSheetPostComments.TAG)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onOpenPost(postId: Long) {
|
||||||
|
PostViewerActivity.startActivity(requireContext(), postId)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onProfileClick(userId: Int) {
|
override fun onProfileClick(userId: Int) {
|
||||||
TODO("Not yet implemented")
|
ProfileActivity.startActivity(requireContext(), userId)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
package com.isolaatti.posting
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import com.isolaatti.common.IsolaattiBaseActivity
|
||||||
|
import com.isolaatti.databinding.ActivityCreatePostBinding
|
||||||
|
import com.isolaatti.databinding.ActivityPostViewerBinding
|
||||||
|
|
||||||
|
class PostViewerActivity : IsolaattiBaseActivity() {
|
||||||
|
companion object {
|
||||||
|
const val POST_ID = "postId"
|
||||||
|
fun startActivity(context: Context, postId: Long) {
|
||||||
|
context.startActivity(Intent(context, PostViewerActivity::class.java).apply {
|
||||||
|
putExtra(POST_ID, postId)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private lateinit var binding: ActivityPostViewerBinding
|
||||||
|
|
||||||
|
private var postId: Long? = null
|
||||||
|
override fun onRetry() {
|
||||||
|
TODO("Not yet implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
|
binding = ActivityPostViewerBinding.inflate(layoutInflater)
|
||||||
|
|
||||||
|
setContentView(binding.root)
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -21,6 +21,7 @@ import com.isolaatti.posting.common.options_bottom_sheet.domain.OptionClicked
|
|||||||
import com.isolaatti.posting.common.options_bottom_sheet.domain.Options
|
import com.isolaatti.posting.common.options_bottom_sheet.domain.Options
|
||||||
import com.isolaatti.posting.common.options_bottom_sheet.presentation.BottomSheetPostOptionsViewModel
|
import com.isolaatti.posting.common.options_bottom_sheet.presentation.BottomSheetPostOptionsViewModel
|
||||||
import com.isolaatti.posting.common.options_bottom_sheet.ui.BottomSheetPostOptionsFragment
|
import com.isolaatti.posting.common.options_bottom_sheet.ui.BottomSheetPostOptionsFragment
|
||||||
|
import com.isolaatti.profile.ui.ProfileActivity
|
||||||
import com.isolaatti.utils.PicassoImagesPluginDef
|
import com.isolaatti.utils.PicassoImagesPluginDef
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
import io.noties.markwon.AbstractMarkwonPlugin
|
import io.noties.markwon.AbstractMarkwonPlugin
|
||||||
@ -125,6 +126,6 @@ class BottomSheetPostComments() : BottomSheetDialogFragment(), OnUserInteractedC
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onProfileClick(userId: Int) {
|
override fun onProfileClick(userId: Int) {
|
||||||
|
ProfileActivity.startActivity(requireContext(), userId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4,4 +4,5 @@ interface OnUserInteractedWithPostCallback : OnUserInteractedCallback {
|
|||||||
fun onLiked(postId: Long)
|
fun onLiked(postId: Long)
|
||||||
fun onUnLiked(postId: Long)
|
fun onUnLiked(postId: Long)
|
||||||
fun onComment(postId: Long)
|
fun onComment(postId: Long)
|
||||||
|
fun onOpenPost(postId: Long)
|
||||||
}
|
}
|
||||||
@ -10,6 +10,7 @@ import android.widget.TextView
|
|||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import androidx.recyclerview.widget.RecyclerView.ViewHolder
|
import androidx.recyclerview.widget.RecyclerView.ViewHolder
|
||||||
import com.google.android.material.button.MaterialButton
|
import com.google.android.material.button.MaterialButton
|
||||||
|
import com.google.android.material.card.MaterialCardView
|
||||||
import com.isolaatti.R
|
import com.isolaatti.R
|
||||||
import com.isolaatti.posting.posts.data.remote.FeedDto
|
import com.isolaatti.posting.posts.data.remote.FeedDto
|
||||||
import com.isolaatti.posting.common.domain.OnUserInteractedWithPostCallback
|
import com.isolaatti.posting.common.domain.OnUserInteractedWithPostCallback
|
||||||
@ -57,6 +58,9 @@ class PostsRecyclerViewAdapter (private val markwon: Markwon, private val callba
|
|||||||
} else {
|
} else {
|
||||||
val username: TextView = itemView.findViewById(R.id.text_view_username)
|
val username: TextView = itemView.findViewById(R.id.text_view_username)
|
||||||
username.text = postDto.userName
|
username.text = postDto.userName
|
||||||
|
username.setOnClickListener {
|
||||||
|
callback.onProfileClick(postDto.post.userId)
|
||||||
|
}
|
||||||
|
|
||||||
val profileImageView: ImageView = itemView.findViewById(R.id.avatar_picture)
|
val profileImageView: ImageView = itemView.findViewById(R.id.avatar_picture)
|
||||||
Picasso.get().load(userProfileImage(postDto.post.userId)).into(profileImageView)
|
Picasso.get().load(userProfileImage(postDto.post.userId)).into(profileImageView)
|
||||||
@ -97,6 +101,11 @@ class PostsRecyclerViewAdapter (private val markwon: Markwon, private val callba
|
|||||||
commentsButton.setOnClickListener {
|
commentsButton.setOnClickListener {
|
||||||
callback.onComment(postDto.post.id)
|
callback.onComment(postDto.post.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
itemView.findViewById<MaterialCardView>(R.id.card).setOnClickListener {
|
||||||
|
callback.onOpenPost(postDto.post.id)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.isolaatti.profile.ui
|
package com.isolaatti.profile.ui
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.activity.addCallback
|
import androidx.activity.addCallback
|
||||||
import androidx.activity.viewModels
|
import androidx.activity.viewModels
|
||||||
@ -83,5 +85,11 @@ class ProfileActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val EXTRA_USER_ID = "user_id"
|
const val EXTRA_USER_ID = "user_id"
|
||||||
|
|
||||||
|
fun startActivity(context: Context, userId: Int) {
|
||||||
|
context.startActivity(Intent(context, ProfileActivity::class.java).apply {
|
||||||
|
putExtra(EXTRA_USER_ID, userId)
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
5
app/src/main/res/drawable/baseline_pending_24.xml
Normal file
5
app/src/main/res/drawable/baseline_pending_24.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#000000"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M12,2C6.48,2 2,6.48 2,12c0,5.52 4.48,10 10,10s10,-4.48 10,-10C22,6.48 17.52,2 12,2zM7,13.5c-0.83,0 -1.5,-0.67 -1.5,-1.5c0,-0.83 0.67,-1.5 1.5,-1.5s1.5,0.67 1.5,1.5C8.5,12.83 7.83,13.5 7,13.5zM12,13.5c-0.83,0 -1.5,-0.67 -1.5,-1.5c0,-0.83 0.67,-1.5 1.5,-1.5s1.5,0.67 1.5,1.5C13.5,12.83 12.83,13.5 12,13.5zM17,13.5c-0.83,0 -1.5,-0.67 -1.5,-1.5c0,-0.83 0.67,-1.5 1.5,-1.5s1.5,0.67 1.5,1.5C18.5,12.83 17.83,13.5 17,13.5z"/>
|
||||||
|
</vector>
|
||||||
21
app/src/main/res/layout/activity_post_viewer.xml
Normal file
21
app/src/main/res/layout/activity_post_viewer.xml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Theme.Isolaatti"
|
||||||
|
app:navigationIcon="@drawable/baseline_arrow_back_24"
|
||||||
|
app:navigationIconTint="@color/on_surface"
|
||||||
|
/>
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@ -20,6 +20,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?attr/actionBarSize"
|
android:layout_height="?attr/actionBarSize"
|
||||||
app:navigationIcon="@drawable/baseline_arrow_back_24"
|
app:navigationIcon="@drawable/baseline_arrow_back_24"
|
||||||
|
app:navigationIconTint="@color/on_surface"
|
||||||
app:title="Profile"
|
app:title="Profile"
|
||||||
app:titleCentered="true" />
|
app:titleCentered="true" />
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,10 @@
|
|||||||
android:id="@+id/squads_menu_item"
|
android:id="@+id/squads_menu_item"
|
||||||
android:icon="@drawable/baseline_people_24"
|
android:icon="@drawable/baseline_people_24"
|
||||||
android:title="Squads" />
|
android:title="Squads" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/drafts_menu_item"
|
||||||
|
android:icon="@drawable/baseline_pending_24"
|
||||||
|
android:title="@string/drafts"/>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/settings_menu_item"
|
android:id="@+id/settings_menu_item"
|
||||||
android:icon="@drawable/baseline_settings_24"
|
android:icon="@drawable/baseline_settings_24"
|
||||||
|
|||||||
@ -47,4 +47,5 @@
|
|||||||
<string name="add_image">Add image</string>
|
<string name="add_image">Add image</string>
|
||||||
<string name="what_do_you_want_to_talk_about_markdown_is_compatible_you_can_record_an_audio_if_you_want">What do you want to talk about? Markdown is compatible. You can record an audio if you want.</string>
|
<string name="what_do_you_want_to_talk_about_markdown_is_compatible_you_can_record_an_audio_if_you_want">What do you want to talk about? Markdown is compatible. You can record an audio if you want.</string>
|
||||||
<string name="posted_successfully">Posted!</string>
|
<string name="posted_successfully">Posted!</string>
|
||||||
|
<string name="drafts">Drafts</string>
|
||||||
</resources>
|
</resources>
|
||||||
Loading…
x
Reference in New Issue
Block a user