Make EditActivity consistent and add borders
This commit is contained in:
parent
50ea335a06
commit
aa02be8304
@ -1,12 +1,17 @@
|
||||
package net.helcel.beendroid.activity
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.MenuItem
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import net.helcel.beendroid.R
|
||||
import net.helcel.beendroid.activity.fragment.AboutFragment
|
||||
import net.helcel.beendroid.activity.fragment.LicenseFragment
|
||||
import net.helcel.beendroid.activity.fragment.SettingsFragment
|
||||
import net.helcel.beendroid.countries.Visited
|
||||
import net.helcel.beendroid.countries.World
|
||||
import net.helcel.beendroid.helper.colorPrimary
|
||||
|
||||
|
||||
class EditActivity : AppCompatActivity() {
|
||||
@ -19,6 +24,11 @@ class EditActivity : AppCompatActivity() {
|
||||
|
||||
setContentView(R.layout.activity_edit)
|
||||
|
||||
// Create action bar
|
||||
supportActionBar?.setBackgroundDrawable(colorPrimary(this))
|
||||
supportActionBar?.title = getString(R.string.action_edit)
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
|
||||
visited = Visited(this)
|
||||
visited.load()
|
||||
|
||||
@ -27,4 +37,11 @@ class EditActivity : AppCompatActivity() {
|
||||
list.adapter = FoldingListAdapter(this, World.WWW.children, visited) { }
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
// Configure on back pressed
|
||||
finish()
|
||||
return super.onOptionsItemSelected(item)
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -103,7 +103,7 @@ class MainActivity : AppCompatActivity() {
|
||||
opt.css(css.get())
|
||||
}
|
||||
photoView.setImageLevel(1)
|
||||
photoView.setImageDrawable(PictureDrawable(psvg.getFill().renderToPicture(opt)))
|
||||
photoView.setImageDrawable(PictureDrawable(psvg.get().renderToPicture(opt)))
|
||||
}
|
||||
|
||||
}
|
@ -44,12 +44,8 @@ class PSVGWrapper(ctx: Context) {
|
||||
}.fold("") { acc, e -> acc + e }
|
||||
}
|
||||
|
||||
fun getFill(): SVG {
|
||||
return SVG.getFromString("<svg id=\"map\" xmlns=\"http://www.w3.org/2000/svg\" width=\"1200\" height=\"1200\" x=\"0\" y=\"0\" fill=${colorForeground}>$fm</svg>")
|
||||
}
|
||||
|
||||
fun getDraw(): SVG {
|
||||
return SVG.getFromString("<svg id=\"map\" xmlns=\"http://www.w3.org/2000/svg\" width=\"1200\" height=\"1200\" x=\"0\" y=\"0\" fill-opacity=\"0\" stroke=${colorBackground}>$fm</svg>")
|
||||
fun get(): SVG {
|
||||
return SVG.getFromString("<svg id=\"map\" xmlns=\"http://www.w3.org/2000/svg\" width=\"1200\" height=\"1200\" x=\"0\" y=\"0\" fill=${colorForeground} stroke=${colorBackground} stroke-width=\"0.25px\">$fm</svg>")
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user