Skip to content
Snippets Groups Projects
Commit cca49654 authored by John Carlson's avatar John Carlson
Browse files

Setup debug testing activity

parent 61119e32
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -134,7 +134,7 @@ dependencies {
compile "com.github.Commit451.Reptar:reptar:$reptarVersion@aar"
compile "com.github.Commit451.Reptar:reptar-retrofit:$reptarVersion@aar"
compile "com.github.Commit451.Reptar:reptar-kotlin:$reptarVersion@aar"
compile 'com.github.Commit451:bypasses:1.0.4'
compile 'com.github.Commit451:bypasses:1.1.0'
compile 'com.github.Commit451:ElasticDragDismissLayout:1.0.4'
compile "com.github.Commit451.AdapterLayout:adapterlayout:$adapterLayout"
compile "com.github.Commit451.AdapterLayout:adapterflowlayout:$adapterLayout"
Loading
Loading
Loading
Loading
@@ -98,6 +98,8 @@
android:name=".activity.AttachActivity"
android:theme="@style/Activity.Translucent" />
 
<activity android:name=".activity.DebugActivity" />
<activity
android:name=".activity.RoutingActivity"
android:launchMode="singleTask"
Loading
Loading
package com.commit451.gitlab.activity
import `in`.uncod.android.bypass.Bypass
import `in`.uncod.android.bypass.ImageSpanClickListener
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.support.design.widget.Snackbar
import android.support.v7.widget.Toolbar
import android.text.style.ImageSpan
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import butterknife.BindView
import butterknife.ButterKnife
import com.commit451.bypasspicassoimagegetter.BypassPicassoImageGetter
import com.commit451.gitlab.App
import com.commit451.gitlab.R
import timber.log.Timber
/**
* Displays the current users projects feed
*/
class DebugActivity : BaseActivity() {
companion object {
private val MARKDOWN = "![Image](https://gitlab.com/Commit451/LabCoat/raw/master/art/screenshot-1.png)"
fun newIntent(context: Context): Intent {
val intent = Intent(context, DebugActivity::class.java)
return intent
}
}
@BindView(R.id.root) lateinit var root: ViewGroup
@BindView(R.id.toolbar) lateinit var toolbar: Toolbar
@BindView(R.id.text) lateinit var text: TextView
lateinit var bypass: Bypass
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_debug)
ButterKnife.bind(this)
bypass = Bypass(this)
bypass.setImageSpanClickListener(object : ImageSpanClickListener {
override fun onImageClicked(p0: View?, p1: ImageSpan?, p2: String?) {
Timber.d("Image clicked with url $p2")
Snackbar.make(root, p2.toString(), Snackbar.LENGTH_LONG)
.show()
}
})
toolbar.title = "Here Be Dragons"
toolbar.setNavigationIcon(R.drawable.ic_back_24dp)
toolbar.setNavigationOnClickListener { onBackPressed()}
text.text = bypass.markdownToSpannable(MARKDOWN,
BypassPicassoImageGetter(text, App.get().picasso))
}
}
Loading
Loading
@@ -13,11 +13,11 @@ import timber.log.Timber
*/
object BypassImageGetterFactory {
 
fun create(textView: TextView, picasso: Picasso, baseUrl: String, project: Project): BypassPicassoImageGetter {
fun create(textView: TextView, picasso: Picasso, baseUrl: String, project: Project?): BypassPicassoImageGetter {
val getter = BypassPicassoImageGetter(textView, picasso)
getter.setSourceModifier(BypassPicassoImageGetter.SourceModifier { source ->
if (source.startsWith("/")) {
val url = baseUrl + "/" + project.pathWithNamespace + source
val url = baseUrl + "/" + project?.pathWithNamespace + source
Timber.d(url)
return@SourceModifier url
}
Loading
Loading
Loading
Loading
@@ -16,11 +16,9 @@ import butterknife.OnClick
import com.commit451.alakazam.HideRunnable
import com.commit451.easel.Easel
import com.commit451.gitlab.App
import com.commit451.gitlab.BuildConfig
import com.commit451.gitlab.R
import com.commit451.gitlab.activity.ActivityActivity
import com.commit451.gitlab.activity.GroupsActivity
import com.commit451.gitlab.activity.ProjectsActivity
import com.commit451.gitlab.activity.TodosActivity
import com.commit451.gitlab.activity.*
import com.commit451.gitlab.adapter.AccountAdapter
import com.commit451.gitlab.data.Prefs
import com.commit451.gitlab.event.CloseDrawerEvent
Loading
Loading
@@ -43,14 +41,11 @@ import java.util.*
*/
class LabCoatNavigationView : NavigationView {
 
@BindView(R.id.profile_image)
lateinit var imageProfile: ImageView
@BindView(R.id.profile_user)
lateinit var textUserName: TextView
@BindView(R.id.profile_email)
lateinit var textEmail: TextView
@BindView(R.id.arrow)
lateinit var iconArrow: View
@BindView(R.id.profile_image) lateinit var imageProfile: ImageView
@BindView(R.id.profile_user) lateinit var textUserName: TextView
@BindView(R.id.profile_email) lateinit var textEmail: TextView
@BindView(R.id.arrow) lateinit var iconArrow: View
@BindView(R.id.button_debug) lateinit var buttonDebug: View
 
lateinit var listAccounts: RecyclerView
lateinit var adapterAccounts: AccountAdapter
Loading
Loading
@@ -138,6 +133,11 @@ class LabCoatNavigationView : NavigationView {
Navigator.navigateToUser(context as Activity, imageView, App.get().getAccount().user)
}
 
@OnClick(R.id.button_debug)
fun onDebugClicked() {
context.startActivity(DebugActivity.newIntent(context))
}
@OnClick(R.id.drawer_header)
fun onHeaderClick() {
toggleAccounts()
Loading
Loading
@@ -165,6 +165,9 @@ class LabCoatNavigationView : NavigationView {
val header = inflateHeaderView(R.layout.header_nav_drawer)
ButterKnife.bind(this, header)
 
if (BuildConfig.DEBUG) {
buttonDebug.visibility = View.VISIBLE
}
listAccounts = RecyclerView(context)
listAccounts.layoutManager = LinearLayoutManager(context)
addView(listAccounts)
Loading
Loading
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M5,16c0,3.87 3.13,7 7,7s7,-3.13 7,-7v-4L5,12v4zM16.12,4.37l2.1,-2.1 -0.82,-0.83 -2.3,2.31C14.16,3.28 13.12,3 12,3s-2.16,0.28 -3.09,0.75L6.6,1.44l-0.82,0.83 2.1,2.1C6.14,5.64 5,7.68 5,10v1h14v-1c0,-2.32 -1.14,-4.36 -2.88,-5.63zM9,9c-0.55,0 -1,-0.45 -1,-1s0.45,-1 1,-1 1,0.45 1,1 -0.45,1 -1,1zM15,9c-0.55,0 -1,-0.45 -1,-1s0.45,-1 1,-1 1,0.45 1,1 -0.45,1 -1,1z"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="@+id/file_blob"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="?attr/actionBarSize">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout 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:layout_width="match_parent"
Loading
Loading
@@ -13,7 +12,7 @@
android:contentDescription="@null"
android:fitsSystemWindows="false"
android:scaleType="centerCrop"
app:srcCompat="@drawable/header"/>
app:srcCompat="@drawable/header" />
 
<com.commit451.foregroundviews.ForegroundImageView
android:id="@+id/profile_image"
Loading
Loading
@@ -24,20 +23,20 @@
android:layout_marginTop="16dp"
android:fitsSystemWindows="true"
android:foreground="?attr/selectableItemBackgroundBorderless"
tools:src="@drawable/ic_assign_24dp"/>
tools:src="@drawable/ic_assign_24dp" />
 
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/gradient_header"/>
android:background="@drawable/gradient_header" />
 
<FrameLayout
android:id="@+id/drawer_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:padding="16dp"
android:background="?attr/selectableItemBackground">
android:background="?attr/selectableItemBackground"
android:padding="16dp">
 
<LinearLayout
android:layout_width="match_parent"
Loading
Loading
@@ -53,7 +52,7 @@
android:textColor="@color/white"
android:textSize="14sp"
app:typeface="roboto_medium"
tools:text="Jawnnypew"/>
tools:text="Jawnnypew" />
 
<TextView
android:id="@+id/profile_email"
Loading
Loading
@@ -63,7 +62,7 @@
android:singleLine="true"
android:textColor="@color/white"
android:textSize="14sp"
tools:text="poop123@aol.com"/>
tools:text="poop123@aol.com" />
</LinearLayout>
 
<ImageView
Loading
Loading
@@ -75,12 +74,21 @@
app:srcCompat="@drawable/ic_arrow_down_24dp" />
</FrameLayout>
 
<ImageView
android:id="@+id/button_debug"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@null"
android:padding="8dp"
android:visibility="gone"
app:srcCompat="@drawable/ic_adb_white_24dp" />
 
<android.support.v7.widget.RecyclerView
android:id="@+id/account_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
/>
android:visibility="gone" />
 
</FrameLayout>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment