I hereby claim:
- I am ntlv on github.
- I am ntlv (https://keybase.io/ntlv) on keybase.
- I have a public key whose fingerprint is 3FFB 6691 6CAB FA1B E10D 3853 7909 D311 2298 F4A3
To claim this, I am signing this object:
| /* | |
| * Copyright 2020 Google LLC | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| class DebugView @JvmOverloads constructor( | |
| context: Context, | |
| attrs: AttributeSet? = null, | |
| defStyleAttr: Int = 0 | |
| ) : View(context, attrs, defStyleAttr) { | |
| var debugPoint = PointF(0f, 0f) | |
| set(value) { | |
| field = value | |
| invalidate() |
| //Breadth first view tree -> json transformation | |
| private static final String CHILDREN = "children"; | |
| @SuppressWarnings("unchecked") | |
| private Object extract(ViewGroup container) throws JSONException { | |
| final Map<String, Object> result = new HashMap<>(); //create root node | |
| List<Object> currentNodeList = new LinkedList<>(); |
I hereby claim:
To claim this, I am signing this object:
| private void showFragmentRoutine(Class<?> fragment, String tag) { | |
| try { | |
| FragmentManager fm = getFragmentManager(); | |
| if (fm.findFragmentByTag(tag) != null) { | |
| fm.popBackStack(tag, 0); | |
| } else { | |
| fm.beginTransaction() | |
| .replace(R.id.container, (Fragment) Class.forName(fragment.getName()).newInstance(), tag) | |
| .addToBackStack(tag) | |
| .commit(); |