Skip to content

Commit

Permalink
Fixed tag activity
Browse files Browse the repository at this point in the history
  • Loading branch information
feelfreelinux committed Nov 26, 2017
1 parent 9444086 commit d22d17f
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ android {
applicationId "io.github.feelfreelinux.wykopmobilny"
minSdkVersion 17
targetSdkVersion 26
versionCode 12
versionName "0.3.2"
versionCode 13
versionName "0.3.2.1"

def credentialsPropertiesFile = rootProject.file("credentials.properties")
def credentialsProperties = new Properties()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ class NavigationActivity : BaseActivity(), MainNavigationView, NavigationView.On
findItem(R.id.login).isVisible = !value
findItem(R.id.logout).isVisible = value
}
fab.isVisible = value
navHeader.view_container.isVisible = value
navHeader.view_container.apply {
nav_notifications_tag.setOnClickListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import io.github.feelfreelinux.wykopmobilny.models.pojo.apiv2.models.TagMetaResp
import io.github.feelfreelinux.wykopmobilny.models.pojo.apiv2.models.TagStateResponse
import io.github.feelfreelinux.wykopmobilny.ui.modules.NavigatorApi
import io.github.feelfreelinux.wykopmobilny.ui.modules.mikroblog.feed.tag.entries.TagEntriesFragment
import io.github.feelfreelinux.wykopmobilny.utils.isVisible
import io.github.feelfreelinux.wykopmobilny.utils.printout
import io.github.feelfreelinux.wykopmobilny.utils.usermanager.UserManagerApi
import io.github.feelfreelinux.wykopmobilny.utils.wykop_link_handler.linkparser.TagLinkParser
Expand All @@ -27,6 +28,7 @@ import javax.inject.Inject
class TagActivity : BaseActivity() {
private lateinit var entryTag : String
@Inject lateinit var navigator : NavigatorApi
@Inject lateinit var userManagerApi : UserManagerApi

companion object {
val EXTRA_TAG = "EXTRA_TAG"
Expand All @@ -49,6 +51,7 @@ class TagActivity : BaseActivity() {
fab.setOnClickListener {
navigator.openAddEntryActivity(this)
}
fab.isVisible = userManagerApi.isUserAuthorized()

supportActionBar?.apply {
setDisplayHomeAsUpEnabled(true)
Expand All @@ -61,6 +64,6 @@ class TagActivity : BaseActivity() {

override fun onOptionsItemSelected(item: MenuItem): Boolean {
if (item.itemId == android.R.id.home) finish()
return true
return false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import io.github.feelfreelinux.wykopmobilny.models.pojo.apiv2.models.TagMetaResp
import io.github.feelfreelinux.wykopmobilny.models.pojo.apiv2.models.TagStateResponse
import io.github.feelfreelinux.wykopmobilny.ui.modules.NavigatorApi
import io.github.feelfreelinux.wykopmobilny.ui.modules.mikroblog.feed.EntryFeedFragment
import io.github.feelfreelinux.wykopmobilny.utils.printout
import io.github.feelfreelinux.wykopmobilny.utils.usermanager.UserManagerApi
import javax.inject.Inject

Expand Down Expand Up @@ -88,6 +89,7 @@ class TagEntriesFragment : EntryFeedFragment(), TagEntriesView {
R.id.action_unobserve -> presenter.unobserveTag()
R.id.action_block -> presenter.blockTag()
R.id.action_unblock -> presenter.unblockTag()
android.R.id.home -> activity.finish()
}
return super.onOptionsItemSelected(item)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,12 @@ class WykopImageView(context: Context, attrs: AttributeSet) : ImageView(context,
}
}

/*override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec)
if (heightMeasureSpec > maxHeight || heightMeasureSpec == 0) {
setMeasuredDimension(widthMeasureSpec, MeasureSpec.makeMeasureSpec(maxHeight,
MeasureSpec.getMode(widthMeasureSpec)))
}
}*/

}
6 changes: 4 additions & 2 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@
</style>

<style name="WykopImageView">
<item name="android:layout_height">300dp</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:maxHeight">700dp</item>
<item name="android:adjustViewBounds">true</item>
<item name="android:layout_width">match_parent</item>
<item name="android:scaleType">centerCrop</item>
</style>

Expand Down

0 comments on commit d22d17f

Please sign in to comment.