diff --git a/build.gradle b/build.gradle index c23cc5415..a6f842479 100644 --- a/build.gradle +++ b/build.gradle @@ -1,12 +1,12 @@ buildscript { ext { kotlinVersion = '1.3.61' - androidGradleVersion = '3.5.3' + androidGradleVersion = '3.6.0' // Google libraries appCompatVersion = '1.1.0' constraintLayoutVersion = '1.1.3' - materialComponentsVersion = '1.1.0-rc02' + materialComponentsVersion = '1.1.0' roomVersion = '2.2.3' lifecycleVersion = '2.2.0' diff --git a/gradle.properties b/gradle.properties index b5e75b03b..5f446eda8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,6 +16,8 @@ org.gradle.jvmargs=-Xmx1536m # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects org.gradle.parallel=true +android.useAndroidX=true + VERSION_NAME=3.1.2 # 3*100*100 + 1*100 + 2 => 30102 VERSION_CODE=30102 diff --git a/library/src/main/AndroidManifest.xml b/library/src/main/AndroidManifest.xml index c37e83aa2..23747160c 100644 --- a/library/src/main/AndroidManifest.xml +++ b/library/src/main/AndroidManifest.xml @@ -8,9 +8,11 @@ android:launchMode="singleTask" android:taskAffinity="com.chuckerteam.chucker.task" android:theme="@style/Chucker.Theme" /> + + diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/MainActivity.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/MainActivity.kt index b85345213..42ab63be6 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/MainActivity.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/MainActivity.kt @@ -28,16 +28,16 @@ internal class MainActivity : super.onCreate(savedInstanceState) setContentView(R.layout.chucker_activity_main) - val toolbar = findViewById(R.id.toolbar) + val toolbar = findViewById(R.id.chuckerTransactionToolbar) setSupportActionBar(toolbar) toolbar.subtitle = applicationName viewModel = ViewModelProvider(this).get(MainViewModel::class.java) - viewPager = findViewById(R.id.viewPager) + viewPager = findViewById(R.id.chuckerMainViewPager) viewPager.adapter = HomePageAdapter(this, supportFragmentManager) - val tabLayout = findViewById(R.id.tabLayout) + val tabLayout = findViewById(R.id.chuckerMainTabLayout) tabLayout.setupWithViewPager(viewPager) viewPager.addOnPageChangeListener(object : TabLayout.TabLayoutOnPageChangeListener(tabLayout) { diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorActivity.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorActivity.kt index 0f87836e2..bffd62fea 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorActivity.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorActivity.kt @@ -30,15 +30,15 @@ internal class ErrorActivity : BaseChuckerActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.chucker_activity_error) - setSupportActionBar(findViewById(R.id.toolbar)) + setSupportActionBar(findViewById(R.id.chuckerErrorToolbar)) supportActionBar?.setDisplayHomeAsUpEnabled(true) - title = findViewById(R.id.toolbar_title) - tag = findViewById(R.id.tag) - clazz = findViewById(R.id.clazz) - message = findViewById(R.id.message) - date = findViewById(R.id.date) - stacktrace = findViewById(R.id.stacktrace) + title = findViewById(R.id.chuckerErrorToolbarTitle) + tag = findViewById(R.id.chuckerItemErrorTag) + clazz = findViewById(R.id.chuckerItemErrorClazz) + message = findViewById(R.id.chuckerItemErrorMessage) + date = findViewById(R.id.chuckerItemErrorDate) + stacktrace = findViewById(R.id.chuckerErrorStacktrace) date.visibility = View.GONE throwableId = intent.getLongExtra(EXTRA_THROWABLE_ID, 0) diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorAdapter.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorAdapter.kt index 4b4c1ed6a..330683f03 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorAdapter.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorAdapter.kt @@ -40,10 +40,10 @@ internal class ErrorAdapter( itemView: View ) : RecyclerView.ViewHolder(itemView), View.OnClickListener { - private val tagView: TextView = itemView.findViewById(R.id.tag) - private val clazzView: TextView = itemView.findViewById(R.id.clazz) - private val messageView: TextView = itemView.findViewById(R.id.message) - private val dateView: TextView = itemView.findViewById(R.id.date) + private val tagView: TextView = itemView.findViewById(R.id.chuckerItemErrorTag) + private val clazzView: TextView = itemView.findViewById(R.id.chuckerItemErrorClazz) + private val messageView: TextView = itemView.findViewById(R.id.chuckerItemErrorMessage) + private val dateView: TextView = itemView.findViewById(R.id.chuckerItemErrorDate) private var throwableId: Long? = null init { diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorListFragment.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorListFragment.kt index a7fd06e42..469895a6c 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorListFragment.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/error/ErrorListFragment.kt @@ -35,10 +35,10 @@ internal class ErrorListFragment : Fragment() { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { return inflater.inflate(R.layout.chucker_fragment_error_list, container, false).apply { - tutorialView = findViewById(R.id.tutorial) - findViewById(R.id.link).movementMethod = LinkMovementMethod.getInstance() + tutorialView = findViewById(R.id.chuckerErrorsTutorialView) + findViewById(R.id.chuckerErrorsTutorialLink).movementMethod = LinkMovementMethod.getInstance() - val recyclerView = findViewById(R.id.list) + val recyclerView = findViewById(R.id.chuckerErrorsRecyclerView) recyclerView.addItemDecoration(DividerItemDecoration(context, VERTICAL)) adapter = ErrorAdapter(listener) recyclerView.adapter = adapter diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionActivity.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionActivity.kt index a8cb99c45..743d351e1 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionActivity.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionActivity.kt @@ -33,15 +33,15 @@ internal class TransactionActivity : BaseChuckerActivity() { viewModel = ViewModelProvider(this, TransactionViewModelFactory(transactionId)) .get(TransactionViewModel::class.java) - val toolbar = findViewById(R.id.toolbar) + val toolbar = findViewById(R.id.chuckerTransactionToolbar) setSupportActionBar(toolbar) - title = findViewById(R.id.toolbar_title) + title = findViewById(R.id.chuckerTransactionToolbarTitle) supportActionBar?.setDisplayHomeAsUpEnabled(true) - findViewById(R.id.viewpager)?.let { viewPager -> + findViewById(R.id.chuckerTransactionViewPager)?.let { viewPager -> setupViewPager(viewPager) - findViewById(R.id.tabs).setupWithViewPager(viewPager) + findViewById(R.id.chuckerTransactionTabLayout).setupWithViewPager(viewPager) } } diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionAdapter.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionAdapter.kt index 79cf7d160..b1ca3db33 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionAdapter.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionAdapter.kt @@ -46,13 +46,13 @@ internal class TransactionAdapter internal constructor( } inner class ViewHolder(val view: View) : RecyclerView.ViewHolder(view) { - private val code: TextView = view.findViewById(R.id.code) - private val path: TextView = view.findViewById(R.id.path) - private val host: TextView = view.findViewById(R.id.host) - private val start: TextView = view.findViewById(R.id.time_start) - private val duration: TextView = view.findViewById(R.id.duration) - private val size: TextView = view.findViewById(R.id.size) - private val ssl: ImageView = view.findViewById(R.id.ssl) + private val code: TextView = view.findViewById(R.id.chuckerTransactionItemCode) + private val path: TextView = view.findViewById(R.id.chuckerTransactionItemPath) + private val host: TextView = view.findViewById(R.id.chuckerTransactionItemHost) + private val start: TextView = view.findViewById(R.id.chuckerTransactionItemTimeStart) + private val duration: TextView = view.findViewById(R.id.chuckerTransactionItemDuration) + private val size: TextView = view.findViewById(R.id.chuckerTransactionItemSize) + private val ssl: ImageView = view.findViewById(R.id.chuckerTransactionItemSsl) @SuppressLint("SetTextI18n") fun bind(transaction: HttpTransactionTuple) { diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionListFragment.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionListFragment.kt index 5d455cd47..2ef349b16 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionListFragment.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionListFragment.kt @@ -40,10 +40,10 @@ internal class TransactionListFragment : savedInstanceState: Bundle? ): View? { val view = inflater.inflate(R.layout.chucker_fragment_transaction_list, container, false) - tutorialView = view.findViewById(R.id.tutorial) - view.findViewById(R.id.link).movementMethod = LinkMovementMethod.getInstance() + tutorialView = view.findViewById(R.id.chuckerTransactionsTutorialView) + view.findViewById(R.id.chuckerTransactionsLink).movementMethod = LinkMovementMethod.getInstance() - val recyclerView = view.findViewById(R.id.list) + val recyclerView = view.findViewById(R.id.chuckerTransactionsRecyclerView) val context = view.context recyclerView.addItemDecoration( DividerItemDecoration(context, DividerItemDecoration.VERTICAL) diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionOverviewFragment.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionOverviewFragment.kt index 1fc6039f9..f678689a6 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionOverviewFragment.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionOverviewFragment.kt @@ -41,18 +41,18 @@ internal class TransactionOverviewFragment : Fragment() { ): View? = inflater.inflate(R.layout.chucker_fragment_transaction_overview, container, false) .also { - url = it.findViewById(R.id.url) - method = it.findViewById(R.id.method) - protocol = it.findViewById(R.id.protocol) - status = it.findViewById(R.id.status) - response = it.findViewById(R.id.response) - ssl = it.findViewById(R.id.ssl) - requestTime = it.findViewById(R.id.request_time) - responseTime = it.findViewById(R.id.response_time) - duration = it.findViewById(R.id.duration) - requestSize = it.findViewById(R.id.request_size) - responseSize = it.findViewById(R.id.response_size) - totalSize = it.findViewById(R.id.total_size) + url = it.findViewById(R.id.chuckerTransactionOverviewUrl) + method = it.findViewById(R.id.chuckerTransactionOverviewMethod) + protocol = it.findViewById(R.id.chuckerTransactionOverviewProtocol) + status = it.findViewById(R.id.chuckerTransactionOverviewStatus) + response = it.findViewById(R.id.chuckerTransactionOverviewResponse) + ssl = it.findViewById(R.id.chuckerTransactionOverviewSsl) + requestTime = it.findViewById(R.id.chuckerTransactionOverviewRequestTime) + responseTime = it.findViewById(R.id.chuckerTransactionOverviewResponseTime) + duration = it.findViewById(R.id.chuckerTransactionOverviewDuration) + requestSize = it.findViewById(R.id.chuckerTransactionOverviewRequestSize) + responseSize = it.findViewById(R.id.chuckerTransactionOverviewResponseSize) + totalSize = it.findViewById(R.id.chuckerTransactionOverviewTotalSize) } override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionPayloadAdapter.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionPayloadAdapter.kt index bfbefe095..8b8698b48 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionPayloadAdapter.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionPayloadAdapter.kt @@ -96,7 +96,7 @@ internal sealed class TransactionPayloadViewHolder(view: View) : RecyclerView.Vi abstract fun bind(item: TransactionPayloadItem) internal class HeaderViewHolder(view: View) : TransactionPayloadViewHolder(view) { - private val headersView: TextView = view.findViewById(R.id.headers) + private val headersView: TextView = view.findViewById(R.id.chuckerTransactionResponseHeaders) override fun bind(item: TransactionPayloadItem) { if (item is TransactionPayloadItem.HeaderItem) { headersView.text = item.headers @@ -105,7 +105,7 @@ internal sealed class TransactionPayloadViewHolder(view: View) : RecyclerView.Vi } internal class BodyLineViewHolder(view: View) : TransactionPayloadViewHolder(view) { - private val bodyLineView: TextView = view.findViewById(R.id.body_line) + private val bodyLineView: TextView = view.findViewById(R.id.chuckerTransactionResponseBodyLine) override fun bind(item: TransactionPayloadItem) { if (item is TransactionPayloadItem.BodyLineItem) { bodyLineView.text = item.line @@ -114,7 +114,7 @@ internal sealed class TransactionPayloadViewHolder(view: View) : RecyclerView.Vi } internal class ImageViewHolder(view: View) : TransactionPayloadViewHolder(view) { - private val binaryDataView: ImageView = view.findViewById(R.id.binary_data) + private val binaryDataView: ImageView = view.findViewById(R.id.chuckerTransactionResponseBinaryData) override fun bind(item: TransactionPayloadItem) { if (item is TransactionPayloadItem.ImageItem) { binaryDataView.setImageBitmap(item.image) diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionPayloadFragment.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionPayloadFragment.kt index 93312550e..ad219a5db 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionPayloadFragment.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionPayloadFragment.kt @@ -61,9 +61,9 @@ internal class TransactionPayloadFragment : savedInstanceState: Bundle? ): View? = inflater.inflate(R.layout.chucker_fragment_transaction_payload, container, false).apply { - transactionContentList = findViewById(R.id.transaction_content) + transactionContentList = findViewById(R.id.chuckerTransactionResponseRecyclerView) transactionContentList.isNestedScrollingEnabled = false - progressLoading = findViewById(R.id.progress_loading_transaction) + progressLoading = findViewById(R.id.chuckerTransactionLoadingProgress) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { @@ -182,8 +182,8 @@ internal class TransactionPayloadFragment : AsyncTask, Unit, List>() { override fun onPreExecute() { - val progressBar: ProgressBar? = fragment.view?.findViewById(R.id.progress_loading_transaction) - val recyclerView: RecyclerView? = fragment.view?.findViewById(R.id.transaction_content) + val progressBar: ProgressBar? = fragment.view?.findViewById(R.id.chuckerTransactionLoadingProgress) + val recyclerView: RecyclerView? = fragment.view?.findViewById(R.id.chuckerTransactionResponseRecyclerView) progressBar?.visibility = View.VISIBLE recyclerView?.visibility = View.INVISIBLE } @@ -233,8 +233,8 @@ internal class TransactionPayloadFragment : } override fun onPostExecute(result: List) { - val progressBar: ProgressBar? = fragment.view?.findViewById(R.id.progress_loading_transaction) - val recyclerView: RecyclerView? = fragment.view?.findViewById(R.id.transaction_content) + val progressBar: ProgressBar? = fragment.view?.findViewById(R.id.chuckerTransactionLoadingProgress) + val recyclerView: RecyclerView? = fragment.view?.findViewById(R.id.chuckerTransactionResponseRecyclerView) progressBar?.visibility = View.INVISIBLE recyclerView?.visibility = View.VISIBLE recyclerView?.adapter = TransactionBodyAdapter(result) diff --git a/library/src/main/res/drawable/chucker_ic_https_grey.xml b/library/src/main/res/drawable/chucker_ic_https_primary.xml similarity index 93% rename from library/src/main/res/drawable/chucker_ic_https_grey.xml rename to library/src/main/res/drawable/chucker_ic_https_primary.xml index 8ffd1fdd8..84a041788 100644 --- a/library/src/main/res/drawable/chucker_ic_https_grey.xml +++ b/library/src/main/res/drawable/chucker_ic_https_primary.xml @@ -4,6 +4,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/library/src/main/res/layout/chucker_activity_error.xml b/library/src/main/res/layout/chucker_activity_error.xml index 097f746b8..3ea75ce3e 100644 --- a/library/src/main/res/layout/chucker_activity_error.xml +++ b/library/src/main/res/layout/chucker_activity_error.xml @@ -2,33 +2,30 @@ - - + @@ -40,7 +37,7 @@ app:layout_behavior="@string/appbar_scrolling_view_behavior"> - @@ -27,7 +25,7 @@ diff --git a/library/src/main/res/layout/chucker_activity_transaction.xml b/library/src/main/res/layout/chucker_activity_transaction.xml index 68dbbe574..73b3b9e7b 100644 --- a/library/src/main/res/layout/chucker_activity_transaction.xml +++ b/library/src/main/res/layout/chucker_activity_transaction.xml @@ -2,36 +2,33 @@ - - + @@ -39,7 +36,7 @@ diff --git a/library/src/main/res/layout/chucker_fragment_error_list.xml b/library/src/main/res/layout/chucker_fragment_error_list.xml index c0dad621e..51b21faba 100644 --- a/library/src/main/res/layout/chucker_fragment_error_list.xml +++ b/library/src/main/res/layout/chucker_fragment_error_list.xml @@ -3,11 +3,10 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layoutDirection="ltr" android:layout_height="match_parent"> - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + android:layout_height="wrap_content" + android:padding="@dimen/chucker_doub_grid"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/library/src/main/res/layout/chucker_fragment_transaction_payload.xml b/library/src/main/res/layout/chucker_fragment_transaction_payload.xml index e4d0a6e84..842d46d4d 100755 --- a/library/src/main/res/layout/chucker_fragment_transaction_payload.xml +++ b/library/src/main/res/layout/chucker_fragment_transaction_payload.xml @@ -5,11 +5,10 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:animateLayoutChanges="true" - android:layoutDirection="ltr" tools:context="com.chuckerteam.chucker.internal.ui.transaction.TransactionPayloadFragment"> \ No newline at end of file diff --git a/library/src/main/res/layout/chucker_transaction_item_body_line.xml b/library/src/main/res/layout/chucker_transaction_item_body_line.xml index bb01550a5..2d12da4ff 100644 --- a/library/src/main/res/layout/chucker_transaction_item_body_line.xml +++ b/library/src/main/res/layout/chucker_transaction_item_body_line.xml @@ -1,6 +1,6 @@ - - + + \ No newline at end of file diff --git a/library/src/main/res/values/styles.xml b/library/src/main/res/values/styles.xml index 12d96bddf..5beff4991 100644 --- a/library/src/main/res/values/styles.xml +++ b/library/src/main/res/values/styles.xml @@ -1,20 +1,22 @@ - + @@ -25,13 +27,11 @@ \ No newline at end of file diff --git a/sample/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml index f24579121..8cff3729f 100644 --- a/sample/src/main/AndroidManifest.xml +++ b/sample/src/main/AndroidManifest.xml @@ -9,7 +9,6 @@ android:allowBackup="false" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" - android:supportsRtl="true" android:theme="@style/AppTheme" tools:ignore="GoogleAppIndexingWarning">