diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 5f394079ecbd19df8310f6298bc15baaaee69b9f..fc09650aaf7675d9d1117deb068bdc9c99f51cc9 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -49,6 +49,8 @@ android { setProperty("archivesBaseName", "QuasselDroidNG-$versionName") + multiDexEnabled = false + // Disable test runner analytics testInstrumentationRunnerArguments = mapOf( "disableAnalytics" to "true" @@ -80,6 +82,10 @@ android { ) } } + + lintOptions { + disable("ResourceType") + } } dependencies { diff --git a/app/src/main/java/de/kuschku/quasseldroid/ui/chat/ToolbarFragment.kt b/app/src/main/java/de/kuschku/quasseldroid/ui/chat/ToolbarFragment.kt index a54b42ca7f10f649df11cb9ed49b6f621d920930..1ad188e654982c301d09ee0cd2f6790a2346031b 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/ui/chat/ToolbarFragment.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/ui/chat/ToolbarFragment.kt @@ -81,7 +81,7 @@ class ToolbarFragment : ServiceBoundFragment() { this.subtitle = colorizeDescription(data?.description) } else { val description = colorizeDescription(data?.description) - if (description.isNullOrBlank()) { + if (description.isBlank()) { this.subtitle = "Lag: ${lag}ms" } else { this.subtitle = SpanFormatter.format( @@ -101,5 +101,4 @@ class ToolbarFragment : ServiceBoundFragment() { private fun colorizeDescription(description: String?) = ircFormatDeserializer.formatString( requireContext(), description, appearanceSettings.colorizeMirc ) - ?: description } \ No newline at end of file diff --git a/app/src/main/java/de/kuschku/quasseldroid/ui/chat/input/FormatHandler.kt b/app/src/main/java/de/kuschku/quasseldroid/ui/chat/input/FormatHandler.kt index bce5465b27c99e74b7a82bd598064036714f10dd..770e01905b5fbff73547d38bb7772752c4b26c79 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/ui/chat/input/FormatHandler.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/ui/chat/input/FormatHandler.kt @@ -88,9 +88,9 @@ class FormatHandler( return val exists = editText.text.removeSpans<UnderlineSpan, IrcUnderlineSpan>(range) { span -> - when { - span is IrcUnderlineSpan -> span - else -> IrcUnderlineSpan() + when (span) { + is IrcUnderlineSpan -> span + else -> IrcUnderlineSpan() } } @@ -106,9 +106,9 @@ class FormatHandler( return val exists = editText.text.removeSpans<StrikethroughSpan, IrcStrikethroughSpan>(range) { span -> - when { - span is IrcStrikethroughSpan -> span - else -> IrcStrikethroughSpan() + when (span) { + is IrcStrikethroughSpan -> span + else -> IrcStrikethroughSpan() } } diff --git a/app/src/main/java/de/kuschku/quasseldroid/ui/chat/nicks/NickListAdapter.kt b/app/src/main/java/de/kuschku/quasseldroid/ui/chat/nicks/NickListAdapter.kt index dc9ae421479cea2c1b97660d311e1b78f972df4b..4090fe00aa826849d638ef483ee87e81edd463e5 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/ui/chat/nicks/NickListAdapter.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/ui/chat/nicks/NickListAdapter.kt @@ -82,7 +82,7 @@ class NickListAdapter( } companion object { - val VIEWTYPE_ACTIVE = 0 - val VIEWTYPE_AWAY = 1 + const val VIEWTYPE_ACTIVE = 0 + const val VIEWTYPE_AWAY = 1 } } \ No newline at end of file diff --git a/app/src/main/java/de/kuschku/quasseldroid/ui/setup/SetupActivity.kt b/app/src/main/java/de/kuschku/quasseldroid/ui/setup/SetupActivity.kt index 864ce9f869dad2573615cf68c5f4e3b35d3d83d4..ee6e7bd9d51497fced4a34f455b5626992fd0841 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/ui/setup/SetupActivity.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/ui/setup/SetupActivity.kt @@ -54,7 +54,7 @@ abstract class SetupActivity : DaggerAppCompatActivity() { override fun onPageSelected(position: Int) = Unit } - private val pageChangeListener = SetupActivityViewPagerPageChangeListener(this) + private lateinit var pageChangeListener: SetupActivityViewPagerPageChangeListener private fun pageChanged() { currentPage.value = adapter.getItem(viewPager.currentItem) @@ -84,6 +84,8 @@ abstract class SetupActivity : DaggerAppCompatActivity() { fragments.forEach(adapter::addFragment) viewPager.adapter = adapter + pageChangeListener = SetupActivityViewPagerPageChangeListener(this) + button.setOnClickListener { if (viewPager.currentItem == adapter.totalCount - 1) onDoneInternal() diff --git a/app/src/main/java/de/kuschku/quasseldroid/util/QuasseldroidNotificationManager.kt b/app/src/main/java/de/kuschku/quasseldroid/util/QuasseldroidNotificationManager.kt index 29b9039c1c534dbc33da826dfc9ea593c8a670c2..4e27ecfd98f9c9ea696123250e696a056763ca3e 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/util/QuasseldroidNotificationManager.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/util/QuasseldroidNotificationManager.kt @@ -83,7 +83,7 @@ class QuasseldroidNotificationManager(private val context: Context) { } companion object { - val BACKGROUND_NOTIFICATION_ID = Int.MAX_VALUE + const val BACKGROUND_NOTIFICATION_ID = Int.MAX_VALUE } data class Handle( diff --git a/app/src/main/java/de/kuschku/quasseldroid/util/backport/ReadableWrappedChannel.kt b/app/src/main/java/de/kuschku/quasseldroid/util/backport/ReadableWrappedChannel.kt index 92b6c78b987a2d85049a7c7426a914e981e61fb0..a0bf3ecce3fbd297396661aaf547dac340c0adeb 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/util/backport/ReadableWrappedChannel.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/util/backport/ReadableWrappedChannel.kt @@ -61,6 +61,6 @@ class ReadableWrappedChannel( override fun implCloseChannel() = backingStream.close() companion object { - private val PAGE_SIZE = 8192 + private const val PAGE_SIZE = 8192 } } diff --git a/app/src/main/java/de/kuschku/quasseldroid/util/backport/WritableWrappedChannel.kt b/app/src/main/java/de/kuschku/quasseldroid/util/backport/WritableWrappedChannel.kt index e326508e8532a28db5c15178fae1102739ade79e..091db6ab6323daf85c25ed75070b8f910c8b73df 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/util/backport/WritableWrappedChannel.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/util/backport/WritableWrappedChannel.kt @@ -48,6 +48,6 @@ class WritableWrappedChannel( override fun implCloseChannel() = backingStream.close() companion object { - private val PAGE_SIZE = 8192 + private const val PAGE_SIZE = 8192 } } diff --git a/app/src/main/java/de/kuschku/quasseldroid/util/helper/SpannedHelper.kt b/app/src/main/java/de/kuschku/quasseldroid/util/helper/SpannedHelper.kt index 974c257c28e74fd674307e2a62844a461e60b0d0..cb1fdb818f983a1815526bac0011d4c491cfbed7 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/util/helper/SpannedHelper.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/util/helper/SpannedHelper.kt @@ -28,7 +28,7 @@ private class DelimitedRangesSequence( nextSearchIndex = -1 } else { val (index, length) = match - nextItem = currentStartIndex..index - 1 + nextItem = currentStartIndex until index currentStartIndex = index + length nextSearchIndex = currentStartIndex + if (length == 0) 1 else 0 } diff --git a/app/src/main/java/de/kuschku/quasseldroid/util/irc/format/IrcFormatDeserializer.kt b/app/src/main/java/de/kuschku/quasseldroid/util/irc/format/IrcFormatDeserializer.kt index 5c73885da8f06ee2324daab1045e9bf060749bfc..8b36cb6c82d8bbdfcf77b593741c548a88c509b3 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/util/irc/format/IrcFormatDeserializer.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/util/irc/format/IrcFormatDeserializer.kt @@ -96,12 +96,12 @@ class IrcFormatDeserializer @Inject constructor() { normalCount = 0 // If there is an element on stack with the same code, close it - if (bold != null) { + bold = if (bold != null) { if (colorize) bold.apply(plainText, plainText.length) - bold = null + null // Otherwise create a new one } else { - bold = FormatDescription(plainText.length, BoldIrcFormat()) + FormatDescription(plainText.length, BoldIrcFormat()) } } CODE_ITALIC -> { @@ -109,12 +109,12 @@ class IrcFormatDeserializer @Inject constructor() { normalCount = 0 // If there is an element on stack with the same code, close it - if (italic != null) { + italic = if (italic != null) { if (colorize) italic.apply(plainText, plainText.length) - italic = null + null // Otherwise create a new one } else { - italic = FormatDescription(plainText.length, ItalicIrcFormat()) + FormatDescription(plainText.length, ItalicIrcFormat()) } } CODE_UNDERLINE -> { @@ -122,12 +122,12 @@ class IrcFormatDeserializer @Inject constructor() { normalCount = 0 // If there is an element on stack with the same code, close it - if (underline != null) { + underline = if (underline != null) { if (colorize) underline.apply(plainText, plainText.length) - underline = null + null // Otherwise create a new one } else { - underline = FormatDescription(plainText.length, UnderlineIrcFormat()) + FormatDescription(plainText.length, UnderlineIrcFormat()) } } CODE_STRIKETHROUGH -> { @@ -135,12 +135,12 @@ class IrcFormatDeserializer @Inject constructor() { normalCount = 0 // If there is an element on stack with the same code, close it - if (strikethrough != null) { + strikethrough = if (strikethrough != null) { if (colorize) strikethrough.apply(plainText, plainText.length) - strikethrough = null + null // Otherwise create a new one } else { - strikethrough = FormatDescription(plainText.length, StrikethroughIrcFormat()) + FormatDescription(plainText.length, StrikethroughIrcFormat()) } } CODE_MONOSPACE -> { @@ -148,12 +148,12 @@ class IrcFormatDeserializer @Inject constructor() { normalCount = 0 // If there is an element on stack with the same code, close it - if (monospace != null) { + monospace = if (monospace != null) { if (colorize) monospace.apply(plainText, plainText.length) - monospace = null + null // Otherwise create a new one } else { - monospace = FormatDescription(plainText.length, MonospaceIrcFormat()) + FormatDescription(plainText.length, MonospaceIrcFormat()) } } CODE_COLOR -> { @@ -308,7 +308,7 @@ class IrcFormatDeserializer @Inject constructor() { fun applyTo(editable: SpannableStringBuilder, from: Int, to: Int) } - private class FormatDescription<U : IrcFormat>(val start: Int, val format: U) { + private class FormatDescription<out U : IrcFormat>(val start: Int, val format: U) { fun apply(editable: SpannableStringBuilder, end: Int) { format.applyTo(editable, start, end) @@ -387,15 +387,15 @@ class IrcFormatDeserializer @Inject constructor() { } companion object { - val CODE_BOLD = 0x02.toChar() - val CODE_COLOR = 0x03.toChar() - val CODE_HEXCOLOR = 0x04.toChar() - val CODE_ITALIC = 0x1D.toChar() - val CODE_UNDERLINE = 0x1F.toChar() - val CODE_STRIKETHROUGH = 0x1E.toChar() - val CODE_MONOSPACE = 0x11.toChar() - val CODE_SWAP = 0x16.toChar() - val CODE_RESET = 0x0F.toChar() + private const val CODE_BOLD = 0x02.toChar() + private const val CODE_COLOR = 0x03.toChar() + private const val CODE_HEXCOLOR = 0x04.toChar() + private const val CODE_ITALIC = 0x1D.toChar() + private const val CODE_UNDERLINE = 0x1F.toChar() + private const val CODE_STRIKETHROUGH = 0x1E.toChar() + private const val CODE_MONOSPACE = 0x11.toChar() + private const val CODE_SWAP = 0x16.toChar() + private const val CODE_RESET = 0x0F.toChar() /** * Try to read a number from a String in specified bounds diff --git a/app/src/main/java/de/kuschku/quasseldroid/util/irc/format/IrcFormatSerializer.kt b/app/src/main/java/de/kuschku/quasseldroid/util/irc/format/IrcFormatSerializer.kt index 0c316abd7aa2e32b2e33a8d94c301404129106fc..267659da86601da17228d26b79d47a17b2d528a7 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/util/irc/format/IrcFormatSerializer.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/util/irc/format/IrcFormatSerializer.kt @@ -209,14 +209,14 @@ class IrcFormatSerializer @Inject constructor(private val context: Context) { } companion object { - val CODE_BOLD: Char = 0x02.toChar() - val CODE_COLOR: Char = 0x03.toChar() - val CODE_HEXCOLOR = 0x04.toChar() - val CODE_ITALIC: Char = 0x1D.toChar() - val CODE_UNDERLINE: Char = 0x1F.toChar() - val CODE_STRIKETHROUGH = 0x1E.toChar() - val CODE_MONOSPACE = 0x11.toChar() - val CODE_SWAP: Char = 0x16.toChar() - val CODE_RESET: Char = 0x0F.toChar() + private const val CODE_BOLD: Char = 0x02.toChar() + private const val CODE_COLOR: Char = 0x03.toChar() + private const val CODE_HEXCOLOR = 0x04.toChar() + private const val CODE_ITALIC: Char = 0x1D.toChar() + private const val CODE_UNDERLINE: Char = 0x1F.toChar() + private const val CODE_STRIKETHROUGH = 0x1E.toChar() + private const val CODE_MONOSPACE = 0x11.toChar() + private const val CODE_SWAP: Char = 0x16.toChar() + private const val CODE_RESET: Char = 0x0F.toChar() } } diff --git a/app/src/main/java/de/kuschku/quasseldroid/util/quassel/IrcUserUtils.kt b/app/src/main/java/de/kuschku/quasseldroid/util/quassel/IrcUserUtils.kt index 3011988388af692331d363b0bac7306e8e8bba88..403c63523edd4c9183e7392e6032fb02134d219b 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/util/quassel/IrcUserUtils.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/util/quassel/IrcUserUtils.kt @@ -39,19 +39,19 @@ object IrcUserUtils { startIndex: Int? = null, ignoreCase: Boolean = false): Int? { val lastIndex = indexOf(char, startIndex ?: 0, ignoreCase) - if (lastIndex < 0) - return null + return if (lastIndex < 0) + null else - return lastIndex + lastIndex } private fun String.lastIndex(char: Char, startIndex: Int? = null, - ignoreCase: Boolean = false): Int? { - val lastIndex = lastIndexOf(char, startIndex ?: lastIndex, ignoreCase) - if (lastIndex < 0) - return null - else - return lastIndex - } + ignoreCase: Boolean = false): Int? = + lastIndexOf(char, startIndex ?: lastIndex, ignoreCase).let { lastIndex -> + if (lastIndex < 0) + null + else + lastIndex + } } \ No newline at end of file diff --git a/app/src/main/java/de/kuschku/quasseldroid/util/ui/ContextThemeWrapper.kt b/app/src/main/java/de/kuschku/quasseldroid/util/ui/ContextThemeWrapper.kt index ebcc0969debe9a8fef8c969397bc38ca8dd0cf8d..9d6e1242070ea2cf8648210ccea4a8bcad0a26a0 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/util/ui/ContextThemeWrapper.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/util/ui/ContextThemeWrapper.kt @@ -16,7 +16,7 @@ import de.kuschku.quasseldroid.R * * @hide */ -class ContextThemeWrapper : ContextWrapper { +open class ContextThemeWrapper : ContextWrapper { var themeResId: Int = 0 private set private var mTheme: Resources.Theme? = null @@ -70,10 +70,6 @@ class ContextThemeWrapper : ContextWrapper { mTheme = theme } - override fun attachBaseContext(newBase: Context) { - super.attachBaseContext(newBase) - } - /** * Call to set an "override configuration" on this context -- this is * a configuration that replies one or more values of the standard diff --git a/app/src/main/java/de/kuschku/quasseldroid/util/ui/DrawerRecyclerView.kt b/app/src/main/java/de/kuschku/quasseldroid/util/ui/DrawerRecyclerView.kt index 9aa7ca95e92a4be245fdc44fd7f5804edca5fd19..c80c03883340d6e0dcd6cdb898cf2995d9431625 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/util/ui/DrawerRecyclerView.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/util/ui/DrawerRecyclerView.kt @@ -22,10 +22,10 @@ class DrawerRecyclerView @JvmOverloads constructor( init { val a = context.obtainStyledAttributes( attrs, - R.styleable.ScrimInsetsFrameLayout, defStyleAttr, - R.style.Widget_Design_ScrimInsetsFrameLayout + R.styleable.DrawerRecyclerView, defStyleAttr, + R.style.Widget_DrawerRecyclerView ) - mInsetForeground = a.getDrawable(R.styleable.ScrimInsetsFrameLayout_insetForeground) + mInsetForeground = a.getDrawable(R.styleable.DrawerRecyclerView_insetBackground) a.recycle() setWillNotDraw(true) // No need to draw until the insets are adjusted ViewCompat.setOnApplyWindowInsetsListener( diff --git a/app/src/main/java/de/kuschku/quasseldroid/util/ui/MaterialContentLoadingProgressBar.kt b/app/src/main/java/de/kuschku/quasseldroid/util/ui/MaterialContentLoadingProgressBar.kt index e9324978e4e93ceae2a8f0eac513011ca8fe21e2..6856596c424be0f48843c66e5f615229f25d6d4b 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/util/ui/MaterialContentLoadingProgressBar.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/util/ui/MaterialContentLoadingProgressBar.kt @@ -105,7 +105,7 @@ class MaterialContentLoadingProgressBar @JvmOverloads constructor(context: Conte } companion object { - private val MIN_SHOW_TIME = 500 // ms - private val MIN_DELAY = 500 // ms + private const val MIN_SHOW_TIME = 500 // ms + private const val MIN_DELAY = 500 // ms } } diff --git a/app/src/main/java/de/kuschku/quasseldroid/util/ui/NavigationDrawerLayout.kt b/app/src/main/java/de/kuschku/quasseldroid/util/ui/NavigationDrawerLayout.kt index 09f3d52a98ed299f0516d18acfc69f0c82ced62c..dd86776bc4c45d0aa8ca69f46749bad5109e2579 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/util/ui/NavigationDrawerLayout.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/util/ui/NavigationDrawerLayout.kt @@ -37,10 +37,10 @@ class NavigationDrawerLayout @JvmOverloads constructor( init { val a = context.obtainStyledAttributes( attrs, - R.styleable.ScrimInsetsFrameLayout, defStyleAttr, - R.style.Widget_Design_ScrimInsetsFrameLayout + R.styleable.NavigationDrawerLayout, defStyleAttr, + R.style.Widget_NavigationDrawerLayout ) - mInsetForeground = a.getDrawable(R.styleable.ScrimInsetsFrameLayout_insetForeground) + mInsetForeground = a.getDrawable(R.styleable.NavigationDrawerLayout_insetBackground) a.recycle() setWillNotDraw(true) // No need to draw until the insets are adjusted ViewCompat.setOnApplyWindowInsetsListener( diff --git a/app/src/main/res/drawable/ic_format_strikethrough.xml b/app/src/main/res/drawable/ic_format_strikethrough.xml index 4a9ace4d4bbc113ca6f18e8a9ebc1bcbf2a584e0..24c1282a48e7cf5fba3082f251d5aec17407021f 100644 --- a/app/src/main/res/drawable/ic_format_strikethrough.xml +++ b/app/src/main/res/drawable/ic_format_strikethrough.xml @@ -1,4 +1,3 @@ -<!-- drawable/format_strikethrough_variant.xml --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 3db33f9dc2775dfb19bfc6553f5f62687f601294..e786a87566a43fef9fe2782e938d4078c3185c9e 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -22,7 +22,7 @@ android:layout_gravity="start" android:background="?attr/colorBackground" android:fitsSystemWindows="true" - app:insetForeground="?attr/colorPrimaryDark"> + app:insetBackground="?attr/colorPrimaryDark"> <fragment android:id="@+id/fragment_chat_list" diff --git a/app/src/main/res/layout/layout_history.xml b/app/src/main/res/layout/layout_history.xml index 7a07fa7ddf868d8da45e2c4a71dc95b8ce70b590..e424968992aa299a75aa3a8ebe1786e9cc30cbd7 100644 --- a/app/src/main/res/layout/layout_history.xml +++ b/app/src/main/res/layout/layout_history.xml @@ -1,63 +1,57 @@ <?xml version="1.0" encoding="utf-8"?> -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" +<android.support.v7.widget.CardView 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:id="@+id/card_panel" + style="?attr/cardStyle" android:layout_width="fill_parent" - android:layout_height="fill_parent"> - - <android.support.v7.widget.CardView - style="?attr/cardStyle" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:layout_marginBottom="16dp" - android:layout_marginLeft="16dp" - android:layout_marginRight="16dp" - android:layout_marginTop="16dp" - app:cardBackgroundColor="?attr/colorBackgroundCard"> + android:layout_height="fill_parent" + android:layout_marginBottom="16dp" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" + android:layout_marginTop="16dp" + app:cardBackgroundColor="?attr/colorBackgroundCard"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - - <LinearLayout - android:layout_width="match_parent" + android:layout_height="48dp" + android:orientation="horizontal"> + + <TextView + android:layout_width="0dip" + android:layout_height="match_parent" + android:layout_weight="1" + android:gravity="center_vertical|fill_horizontal" + android:paddingLeft="16dp" + android:paddingRight="16dp" + android:text="@string/label_input_history" + android:textAppearance="@style/TextAppearance.AppCompat.Body2" + android:textColor="?attr/colorForegroundSecondary" /> + + <android.support.v7.widget.AppCompatImageView + android:id="@+id/close" + android:layout_width="48dp" android:layout_height="48dp" - android:orientation="horizontal"> - - <TextView - android:layout_width="0dip" - android:layout_height="match_parent" - android:layout_weight="1" - android:gravity="center_vertical|fill_horizontal" - android:paddingLeft="16dp" - android:paddingRight="16dp" - android:text="@string/label_input_history" - android:textAppearance="@style/TextAppearance.AppCompat.Body2" - android:textColor="?attr/colorForegroundSecondary" /> - - <android.support.v7.widget.AppCompatImageView - android:id="@+id/send" - android:layout_width="48dp" - android:layout_height="48dp" - android:layout_gravity="top" - android:background="?attr/selectableItemBackgroundBorderless" - android:padding="12dp" - android:scaleType="fitXY" - app:tint="?attr/colorForegroundSecondary" - app:srcCompat="@drawable/ic_close" /> - - </LinearLayout> - - <android.support.v7.widget.RecyclerView - android:id="@+id/msg_history" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - tools:listitem="@layout/widget_history_message" /> + android:layout_gravity="top" + android:background="?attr/selectableItemBackgroundBorderless" + android:padding="12dp" + android:scaleType="fitXY" + app:srcCompat="@drawable/ic_close" + app:tint="?attr/colorForegroundSecondary" /> </LinearLayout> - </android.support.v7.widget.CardView> + <android.support.v7.widget.RecyclerView + android:id="@+id/msg_history" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + tools:listitem="@layout/widget_history_message" /> + + </LinearLayout> -</FrameLayout> \ No newline at end of file +</android.support.v7.widget.CardView> \ No newline at end of file diff --git a/app/src/main/res/layout/preference_vertical.xml b/app/src/main/res/layout/preference_vertical.xml index f2bd7b80d016f31ed020460b79ae9505519110cf..3799ea31be3edaa1ed04104598ffee600f916fdc 100644 --- a/app/src/main/res/layout/preference_vertical.xml +++ b/app/src/main/res/layout/preference_vertical.xml @@ -26,6 +26,7 @@ android:paddingEnd="?android:attr/listPreferredItemPaddingRight" android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" android:paddingRight="?android:attr/listPreferredItemPaddingRight" + android:baselineAligned="false" android:paddingStart="?android:attr/listPreferredItemPaddingLeft"> <FrameLayout @@ -38,6 +39,8 @@ android:minWidth="60dp" android:orientation="horizontal" android:paddingBottom="4dp" + android:paddingLeft="0dp" + android:paddingStart="0dp" android:paddingEnd="12dp" android:paddingRight="12dp" android:paddingTop="4dp"> diff --git a/app/src/main/res/layout/setup_account_connection.xml b/app/src/main/res/layout/setup_account_connection.xml index 328f2cb3283c7b87e5a9ca32e69008db6fff8bfd..d193007176471468ccba2ec4d835b6dc5ca76b0b 100644 --- a/app/src/main/res/layout/setup_account_connection.xml +++ b/app/src/main/res/layout/setup_account_connection.xml @@ -18,6 +18,7 @@ android:id="@+id/host" android:layout_width="match_parent" android:layout_height="wrap_content" + android:hint="@string/label_connection_host" android:inputType="textUri" /> </android.support.design.widget.TextInputLayout> @@ -33,6 +34,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="number" + android:hint="@string/labelConnectionPort" android:text="@string/defaultConnectionPort" /> </android.support.design.widget.TextInputLayout> diff --git a/app/src/main/res/layout/setup_account_edit.xml b/app/src/main/res/layout/setup_account_edit.xml index b95d98987eee13a6cb2d0050c30588d1791b28f3..471051625ff0a9c4870a49105da79c265e7f0af5 100644 --- a/app/src/main/res/layout/setup_account_edit.xml +++ b/app/src/main/res/layout/setup_account_edit.xml @@ -43,6 +43,7 @@ android:id="@+id/name" android:layout_width="match_parent" android:layout_height="wrap_content" + android:hint="@string/label_account_name" android:inputType="text" /> </android.support.design.widget.TextInputLayout> </LinearLayout> @@ -86,6 +87,7 @@ android:id="@+id/host" android:layout_width="match_parent" android:layout_height="wrap_content" + android:hint="@string/label_connection_host" android:inputType="textUri" /> </android.support.design.widget.TextInputLayout> @@ -105,6 +107,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="number" + android:hint="@string/labelConnectionPort" android:text="@string/defaultConnectionPort" /> </android.support.design.widget.TextInputLayout> </LinearLayout> @@ -150,6 +153,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="textVisiblePassword|textNoSuggestions" + android:hint="@string/label_account_user" app:errorEnabled="true" /> </android.support.design.widget.TextInputLayout> @@ -165,6 +169,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="textPassword" + android:hint="@string/label_account_pass" app:errorEnabled="true" /> </android.support.design.widget.TextInputLayout> diff --git a/app/src/main/res/layout/setup_account_name.xml b/app/src/main/res/layout/setup_account_name.xml index 7321ec065a4564e95f3f2adef275ebd36faf38b6..4b027e387e69524c2aa591abdcd70dc2c20bc842 100644 --- a/app/src/main/res/layout/setup_account_name.xml +++ b/app/src/main/res/layout/setup_account_name.xml @@ -16,6 +16,7 @@ android:id="@+id/name" android:layout_width="match_parent" android:layout_height="wrap_content" + android:hint="@string/label_account_name" android:inputType="text" /> </android.support.design.widget.TextInputLayout> diff --git a/app/src/main/res/layout/setup_account_user.xml b/app/src/main/res/layout/setup_account_user.xml index 60214fa1df96c1389ddff97f841a5bebac4a2d04..0ca50d27146751f197cec1efeb2dc9de1229892e 100644 --- a/app/src/main/res/layout/setup_account_user.xml +++ b/app/src/main/res/layout/setup_account_user.xml @@ -16,6 +16,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="textVisiblePassword|textNoSuggestions" + android:hint="@string/label_account_user" app:errorEnabled="true" /> </android.support.design.widget.TextInputLayout> @@ -31,6 +32,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="textPassword" + android:hint="@string/label_account_pass" app:errorEnabled="true" /> </android.support.design.widget.TextInputLayout> diff --git a/app/src/main/res/layout/widget_core_account_add.xml b/app/src/main/res/layout/widget_core_account_add.xml index f6c839109aa5e42884d241cceb53dad7092f69d1..295b1679c71cf7e3885c1e0d597c6aba734816a0 100644 --- a/app/src/main/res/layout/widget_core_account_add.xml +++ b/app/src/main/res/layout/widget_core_account_add.xml @@ -31,6 +31,6 @@ android:fontFamily="sans-serif-medium" android:lines="1" android:singleLine="true" - android:text="New Account" + android:text="@string/label_new_account" android:textSize="14sp" /> </LinearLayout> diff --git a/app/src/main/res/layout/widget_nick.xml b/app/src/main/res/layout/widget_nick.xml index 91a35f4a4011392f176da556fdf62473a385ad13..b54a3aeda52d5552f74b600f590fa7ffd4cd0497 100644 --- a/app/src/main/res/layout/widget_nick.xml +++ b/app/src/main/res/layout/widget_nick.xml @@ -10,6 +10,7 @@ android:paddingEnd="?listPreferredItemPaddingRight" android:paddingLeft="?listPreferredItemPaddingLeft" android:paddingRight="?listPreferredItemPaddingRight" + android:baselineAligned="false" android:paddingStart="?listPreferredItemPaddingLeft"> <FrameLayout diff --git a/app/src/main/res/layout/widget_nick_away.xml b/app/src/main/res/layout/widget_nick_away.xml index 29837a9bc98f54f398eaab81535d007cc54cf2a3..276583648b3a4498ed549a67fd6d1c2414d03a7d 100644 --- a/app/src/main/res/layout/widget_nick_away.xml +++ b/app/src/main/res/layout/widget_nick_away.xml @@ -10,6 +10,7 @@ android:paddingEnd="?listPreferredItemPaddingRight" android:paddingLeft="?listPreferredItemPaddingLeft" android:paddingRight="?listPreferredItemPaddingRight" + android:baselineAligned="false" android:paddingStart="?listPreferredItemPaddingLeft"> <FrameLayout diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 05a6f9bc48bab60f69b66da1f26344671dc6ad8e..a5f74cb0dd82381c672e5208bd0bf7eeb18b2bf5 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -26,6 +26,7 @@ <string name="label_join">Verbinden</string> <string name="label_libraries">Bibliotheken</string> <string name="label_license">Lizenz</string> + <string name="label_new_account">Account hinzufügen</string> <string name="label_no">Nein</string> <string name="label_open">Öffnen</string> <string name="label_part">Verlassen</string> diff --git a/app/src/main/res/values-de/strings_messages.xml b/app/src/main/res/values-de/strings_messages.xml index aa54ae050c94fb9fdb664f4a36198563c7676cc5..d18185b5f76c4dbc07b46cfd7320c0202bbd4c5e 100644 --- a/app/src/main/res/values-de/strings_messages.xml +++ b/app/src/main/res/values-de/strings_messages.xml @@ -13,7 +13,7 @@ <string name="message_format_action">* %1$s%2$s %3$s</string> <string name="message_format_notice">[%1$s%2$s] %3$s</string> <string name="message_format_nick">%1$s%2$s heißt jetzt %3$s%4$s</string> - <string name="message_format_nick_self">Du heißt jetzt justJanne</string> + <string name="message_format_nick_self">Du heißt jetzt %1$s%2$s</string> <string name="message_format_mode">Modus %1$s durch %2$s%3$s</string> <string name="message_format_join">%1$s%2$s hat %3$s betreten</string> <string name="message_format_part_1">%1$s%2$s hat den Kanal verlassen</string> diff --git a/app/src/main/res/values-de/strings_setup.xml b/app/src/main/res/values-de/strings_setup.xml index e24e3a95cdc10cab00895cc5fd8b78839524ac8c..b63b2ef92ca5488b47e5d70f1216557391eb8fd0 100644 --- a/app/src/main/res/values-de/strings_setup.xml +++ b/app/src/main/res/values-de/strings_setup.xml @@ -3,11 +3,11 @@ <!-- Account Selection --> <string name="slide_account_select_title">Account Auswählen</string> <string name="slide_account_select_description">Wähle einen Account aus oder erstelle einen neuen</string> - <string name="label_user_on_host">%1$s @ %2$s:%3$s</string> + <string name="label_user_on_host">%1$s auf %2$s:%3$d</string> <!-- Account Connection --> <string name="slide_account_connection_title">Verbindung</string> - <string name="slideAccountConnectionDescription">Bitte gebe an die Addresse des Servers an, auf dem dein Core läuft</string> + <string name="slideAccountConnectionDescription">Bitte gebe an die Adresse des Servers an, auf dem dein Core läuft</string> <string name="label_connection_host">Hostname</string> <string name="labelConnectionPort">Port</string> diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index b31f5bb0b4657a49efc3d2288f9161ec38cffdf8..123ee8f5dc465c51cef33d799e3096a8bbd20863 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -158,4 +158,7 @@ <!-- Menu Items --> <attr name="backgroundMenuItem" format="reference" /> + + <!-- InsetLayouts --> + <attr name="insetBackground" format="color|reference" /> </resources> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a25b5e0715b3aba4e2bb2a1a9bda72fe089eabe2..5968a73c7c8d42dfe92632c366edc6f8ec28f1e7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -26,6 +26,7 @@ <string name="label_join">Join</string> <string name="label_libraries">Libraries</string> <string name="label_license">License</string> + <string name="label_new_account">New Account</string> <string name="label_no">No</string> <string name="label_open">Open</string> <string name="label_part">Part</string> @@ -35,7 +36,7 @@ <string name="label_select_multiple">Select</string> <string name="label_settings">Settings</string> <string name="label_share">Share</string> - <string name="label_share_crashreport">Share Crashreport</string> + <string name="label_share_crashreport">Share Crash Report</string> <string name="label_show_hidden">Show Hidden</string> <string name="label_unhide">Make Visible</string> <string name="label_website">Website</string> diff --git a/app/src/main/res/values/styles_widgets.xml b/app/src/main/res/values/styles_widgets.xml index 2524553dd4f169a6210937e25f9275f274434210..831104e6f58819f6a794459eaa020cf8acde5b03 100644 --- a/app/src/main/res/values/styles_widgets.xml +++ b/app/src/main/res/values/styles_widgets.xml @@ -56,4 +56,22 @@ <style name="Widget.DialogTheme" parent="Theme.AppCompat.Dialog.Alert" /> <style name="Widget.DialogTheme.Light" parent="Theme.AppCompat.Light.Dialog.Alert" /> + + <!-- NavigationDrawerLayout --> + <declare-styleable name="NavigationDrawerLayout"> + <attr name="insetBackground" /> + </declare-styleable> + + <style name="Widget.NavigationDrawerLayout" parent=""> + <item name="insetBackground">#4000</item> + </style> + + <!-- DrawerRecyclerView --> + <declare-styleable name="DrawerRecyclerView"> + <attr name="insetBackground" /> + </declare-styleable> + + <style name="Widget.DrawerRecyclerView" parent=""> + <item name="insetBackground">#4000</item> + </style> </resources> diff --git a/lib/src/main/java/de/kuschku/libquassel/protocol/QTypes.kt b/lib/src/main/java/de/kuschku/libquassel/protocol/QTypes.kt index 090db4833a41bce18f21603efbd242d87e958a38..a40e2a8f28e253e464ec43323b9becc0b52d8191 100644 --- a/lib/src/main/java/de/kuschku/libquassel/protocol/QTypes.kt +++ b/lib/src/main/java/de/kuschku/libquassel/protocol/QTypes.kt @@ -55,7 +55,7 @@ fun QVariantList.toVariantMap(): QVariantMap { while (i < size) { val key = get(i).value<ByteBuffer?>().deserializeString(StringSerializer.UTF8) ?: "" val value = get(i + 1) - map.put(key, value) + map[key] = value i += 2 } return map diff --git a/lib/src/main/java/de/kuschku/libquassel/quassel/syncables/IrcUser.kt b/lib/src/main/java/de/kuschku/libquassel/quassel/syncables/IrcUser.kt index ee9a6d5152b817668a762941e5cc8307cc26a414..de37e29f9066557b8dcc238acc75f586ab14ded2 100644 --- a/lib/src/main/java/de/kuschku/libquassel/quassel/syncables/IrcUser.kt +++ b/lib/src/main/java/de/kuschku/libquassel/quassel/syncables/IrcUser.kt @@ -261,14 +261,6 @@ class IrcUser( proxy.stopSynchronize(this) } - override fun addUserModes(modes: String) { - super.addUserModes(modes) - } - - override fun removeUserModes(modes: String) { - super.removeUserModes(modes) - } - fun updateObjectName() { val identifier = "${network().networkId()}/${nick()}" renameObject(identifier) diff --git a/lib/src/main/java/de/kuschku/libquassel/quassel/syncables/Network.kt b/lib/src/main/java/de/kuschku/libquassel/quassel/syncables/Network.kt index a4649b29954cd4148c25fc3fd312512c516121e3..b9fbab55ac6297e7143740799b5c511e1d8d8145 100644 --- a/lib/src/main/java/de/kuschku/libquassel/quassel/syncables/Network.kt +++ b/lib/src/main/java/de/kuschku/libquassel/quassel/syncables/Network.kt @@ -349,24 +349,24 @@ class Network constructor( fun ircUsers() = _ircUsers.values.toList() fun ircUserCount(): UInt = _ircUsers.size - fun newIrcChannel(channelName: String, initData: QVariantMap = emptyMap()): IrcChannel { - val channel = ircChannel(channelName) - if (channel == null) { - val ircChannel = IrcChannel(channelName, this, proxy) - ircChannel.init() - if (initData.isNotEmpty()) { - ircChannel.fromVariantMap(initData) - ircChannel.initialized = true + fun newIrcChannel(channelName: String, initData: QVariantMap = emptyMap()): IrcChannel = + ircChannel(channelName).let { channel -> + return if (channel == null) { + val ircChannel = IrcChannel(channelName, this, proxy) + ircChannel.init() + if (initData.isNotEmpty()) { + ircChannel.fromVariantMap(initData) + ircChannel.initialized = true + } + proxy.synchronize(ircChannel) + _ircChannels[caseMapper.toLowerCase(channelName)] = ircChannel + live_ircChannels.onNext(_ircChannels) + super.addIrcChannel(channelName) + ircChannel + } else { + channel } - proxy.synchronize(ircChannel) - _ircChannels[caseMapper.toLowerCase(channelName)] = ircChannel - live_ircChannels.onNext(_ircChannels) - super.addIrcChannel(channelName) - return ircChannel - } else { - return channel } - } fun ircChannel(channelName: String?) = _ircChannels[channelName?.let(caseMapper::toLowerCase)] fun liveIrcChannel(channelName: String?) = live_ircChannels.map { diff --git a/lib/src/main/java/de/kuschku/libquassel/quassel/syncables/interfaces/invokers/Invokers.kt b/lib/src/main/java/de/kuschku/libquassel/quassel/syncables/interfaces/invokers/Invokers.kt index 23a6d7d5cd551069f83787be391a48b7fb44078f..10c95164293054ee88f6d42367df49f6756a0d25 100644 --- a/lib/src/main/java/de/kuschku/libquassel/quassel/syncables/interfaces/invokers/Invokers.kt +++ b/lib/src/main/java/de/kuschku/libquassel/quassel/syncables/interfaces/invokers/Invokers.kt @@ -68,6 +68,6 @@ object Invokers { private fun <T> register(invoker: Invoker<T>?) { if (invoker != null) - registry.put(invoker.className, invoker) + registry[invoker.className] = invoker } } diff --git a/lib/src/main/java/de/kuschku/libquassel/session/SignalProxy.kt b/lib/src/main/java/de/kuschku/libquassel/session/SignalProxy.kt index bb83b858d8548903ec50db06f39e912d7e21dc18..474d326d96d7a68ad58dd4f325e922f3af833aa7 100644 --- a/lib/src/main/java/de/kuschku/libquassel/session/SignalProxy.kt +++ b/lib/src/main/java/de/kuschku/libquassel/session/SignalProxy.kt @@ -54,8 +54,8 @@ interface SignalProxy { override fun callRpc(slot: String, params: List<QVariant_>) = Unit override fun shouldSync(type: String, instance: String, slot: String) = false override fun shouldRpc(slot: String) = false - override fun network(id: NetworkId) = null - override fun identity(id: IdentityId) = null + override fun network(id: NetworkId): Network? = null + override fun identity(id: IdentityId): Identity? = null override fun renameObject(syncableObject: ISyncableObject, newName: String, oldName: String) = Unit diff --git a/malheur/build.gradle.kts b/malheur/build.gradle.kts index ae8c5953619a9d423cba923603dddaa8f9507a77..f68dd89d175b02bc15e8767b530455b76b8bd880 100644 --- a/malheur/build.gradle.kts +++ b/malheur/build.gradle.kts @@ -9,7 +9,7 @@ android { buildToolsVersion("27.0.3") defaultConfig { - minSdkVersion(9) + minSdkVersion(14) targetSdkVersion(27) consumerProguardFiles("proguard-rules.pro") diff --git a/malheur/src/main/java/de/kuschku/malheur/collectors/Collector.kt b/malheur/src/main/java/de/kuschku/malheur/collectors/Collector.kt index a6720d1bb251e0c72b81cb24e9282a4b03f47611..2128357d7517de5cc3968cdb6818a9e4c0c5c400 100644 --- a/malheur/src/main/java/de/kuschku/malheur/collectors/Collector.kt +++ b/malheur/src/main/java/de/kuschku/malheur/collectors/Collector.kt @@ -2,19 +2,14 @@ package de.kuschku.malheur.collectors import de.kuschku.malheur.CrashContext -interface Collector<out DataType, ConfigType> { +interface Collector<out DataType, in ConfigType> { fun collect(context: CrashContext, config: ConfigType): DataType? } inline fun <DataType, ConfigType> Collector<DataType, ConfigType>.collectIf( context: CrashContext, config: ConfigType? -) = if (config != null) - collect(context, config) -else - null +) = if (config != null) collect(context, config) else null -inline fun <DataType> collectIf(enabled: Boolean, closure: () -> DataType?) = if (enabled) - closure() -else - null +inline fun <DataType> collectIf(enabled: Boolean, closure: () -> DataType?) = + if (enabled) closure() else null diff --git a/persistence/src/main/AndroidManifest.xml b/persistence/src/main/AndroidManifest.xml index e2083427300b98f728c483f2f1b0a1bbd1e18236..96a12a1ab2ae208266b65982165fbde0230f4593 100644 --- a/persistence/src/main/AndroidManifest.xml +++ b/persistence/src/main/AndroidManifest.xml @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="utf-8"?> -<manifest package="de.kuschku.quasseldroid.persistence"></manifest> +<manifest package="de.kuschku.quasseldroid.persistence" /> diff --git a/persistence/src/main/java/de/kuschku/quasseldroid/persistence/QuasselDatabase.kt b/persistence/src/main/java/de/kuschku/quasseldroid/persistence/QuasselDatabase.kt index ee90f84629e7af522d59b32958bde10132dd0ce1..056b8bc66a94f2a0585008005e6ea4af367a9601 100644 --- a/persistence/src/main/java/de/kuschku/quasseldroid/persistence/QuasselDatabase.kt +++ b/persistence/src/main/java/de/kuschku/quasseldroid/persistence/QuasselDatabase.kt @@ -207,39 +207,5 @@ FROM WHERE bufferId = ? AND type & ~? > 0 ) t -ORDER BY time, messageId DESC - """, arrayOf(bufferId, type, bufferId, bufferId, type))) - -fun QuasselDatabase.MessageDao.findByBufferIdWithDayChange(bufferId: Int, type: Int) = - this.findMessagesRaw(SimpleSQLiteQuery(""" -SELECT t.* -FROM - ( - SELECT - messageId, - time, - type, - flag, - bufferId, - sender, - senderPrefixes, - content - FROM message - WHERE bufferId = ? - AND type & ~? > 0 - UNION ALL - SELECT DISTINCT - strftime('%s', date(datetime(time / 1000, 'unixepoch'))) * -1000 AS messageId, - strftime('%s', date(datetime(time / 1000, 'unixepoch'))) * 1000 AS time, - 8192 AS type, - 0 AS flag, - ? AS bufferId, - '' AS sender, - '' AS senderPrefixes, - '' AS content - FROM message - WHERE bufferId = ? - AND type & ~? > 0 - ) t -ORDER BY time, messageId DESC +ORDER BY time DESC, messageId DESC """, arrayOf(bufferId, type, bufferId, bufferId, type))) \ No newline at end of file diff --git a/slidingpanel/src/main/AndroidManifest.xml b/slidingpanel/src/main/AndroidManifest.xml index e8ac6fcc6ce9e85bd2a39e1b6ac540dd9881480c..30c18586b960c94687f4963f04a02cdf3afd9319 100644 --- a/slidingpanel/src/main/AndroidManifest.xml +++ b/slidingpanel/src/main/AndroidManifest.xml @@ -2,4 +2,4 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.sothree.slidinguppanel.library" android:versionCode="17" - android:versionName="3.4.0"></manifest> + android:versionName="3.4.0" /> diff --git a/slidingpanel/src/main/java/com/sothree/slidinguppanel/SlidingUpPanelLayout.java b/slidingpanel/src/main/java/com/sothree/slidinguppanel/SlidingUpPanelLayout.java index bc850c0f193e5ddb097819ab244f9a6a888a6458..9feba814eefe8e00d9d81cc0a83ff5b0d798b373 100644 --- a/slidingpanel/src/main/java/com/sothree/slidinguppanel/SlidingUpPanelLayout.java +++ b/slidingpanel/src/main/java/com/sothree/slidinguppanel/SlidingUpPanelLayout.java @@ -392,7 +392,6 @@ public class SlidingUpPanelLayout extends ViewGroup { if (getPanelState() == PanelState.COLLAPSED) { smoothToBottom(); invalidate(); - return; } } @@ -495,7 +494,6 @@ public class SlidingUpPanelLayout extends ViewGroup { } } }); - ; } } @@ -733,12 +731,16 @@ public class SlidingUpPanelLayout extends ViewGroup { } int childWidthSpec; - if (lp.width == LayoutParams.WRAP_CONTENT) { - childWidthSpec = MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST); - } else if (lp.width == LayoutParams.MATCH_PARENT) { - childWidthSpec = MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY); - } else { - childWidthSpec = MeasureSpec.makeMeasureSpec(lp.width, MeasureSpec.EXACTLY); + switch (lp.width) { + case LayoutParams.WRAP_CONTENT: + childWidthSpec = MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST); + break; + case LayoutParams.MATCH_PARENT: + childWidthSpec = MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY); + break; + default: + childWidthSpec = MeasureSpec.makeMeasureSpec(lp.width, MeasureSpec.EXACTLY); + break; } int childHeightSpec; @@ -1328,14 +1330,14 @@ public class SlidingUpPanelLayout extends ViewGroup { * @param panel The child view that was moved * @param slideOffset The new offset of this sliding pane within its range, from 0-1 */ - public void onPanelSlide(View panel, float slideOffset); + void onPanelSlide(View panel, float slideOffset); /** * Called when a sliding panel state changes * * @param panel The child view that was slid to an collapsed position */ - public void onPanelStateChanged(View panel, PanelState previousState, PanelState newState); + void onPanelStateChanged(View panel, PanelState previousState, PanelState newState); } /** diff --git a/slidingpanel/src/main/res/drawable/above_shadow.xml b/slidingpanel/src/main/res/drawable/above_shadow.xml index b51564520ea071013813e7a1f3be6270ef293f3b..7d0cbe926aab000ee5744562de5eb9c224e75cd8 100644 --- a/slidingpanel/src/main/res/drawable/above_shadow.xml +++ b/slidingpanel/src/main/res/drawable/above_shadow.xml @@ -3,5 +3,5 @@ <gradient android:angle="90" android:endColor="@android:color/transparent" - android:startColor="#20000000"></gradient> + android:startColor="#20000000" /> </shape> \ No newline at end of file diff --git a/slidingpanel/src/main/res/drawable/below_shadow.xml b/slidingpanel/src/main/res/drawable/below_shadow.xml index fc63fea99984d27df658a0057ad249645826b969..6af78fe1f6a6e9855dfa4c3e1abda773d78aa9d5 100644 --- a/slidingpanel/src/main/res/drawable/below_shadow.xml +++ b/slidingpanel/src/main/res/drawable/below_shadow.xml @@ -3,5 +3,5 @@ <gradient android:angle="270" android:endColor="@android:color/transparent" - android:startColor="#20000000"></gradient> + android:startColor="#20000000" /> </shape> \ No newline at end of file