-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
738aaf3
commit 7728763
Showing
21 changed files
with
1,965 additions
and
756 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
924 changes: 581 additions & 343 deletions
924
app/src/main/java/it/anyplace/syncbrowser/MainActivity.java
Large diffs are not rendered by default.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
app/src/main/java/it/anyplace/syncbrowser/utils/ViewUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright (C) 2016 Davide Imbriaco | ||
* | ||
* This Java file is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package it.anyplace.syncbrowser.utils; | ||
|
||
import android.view.View; | ||
import android.view.ViewGroup; | ||
|
||
import com.google.common.base.Predicates; | ||
import com.google.common.collect.Iterables; | ||
import com.google.common.collect.Lists; | ||
|
||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
import static com.google.common.base.Objects.equal; | ||
|
||
public class ViewUtils { | ||
|
||
public static Iterable<View> listViews(View rootView){ | ||
return listViews(rootView,null); | ||
} | ||
|
||
public static <E extends View> Iterable<E> listViews(View rootView,@Nullable Class<E> clazz){ | ||
if(clazz == null){ | ||
if(rootView==null){ | ||
return Collections.emptyList(); | ||
}else { | ||
if(rootView instanceof ViewGroup){ | ||
List list=Lists.newArrayList(); | ||
ViewGroup viewGroup=(ViewGroup)rootView; | ||
list.add(viewGroup); | ||
for(int i=0;i<viewGroup.getChildCount();i++){ | ||
list.addAll((Collection)listViews(viewGroup.getChildAt(i),null)); | ||
} | ||
return list; | ||
}else{ | ||
return (Iterable)Collections.singletonList(rootView); | ||
} | ||
} | ||
}else{ | ||
return Iterables.filter((Iterable)listViews(rootView,null), Predicates.<Object>instanceOf(clazz)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item> | ||
<shape android:shape="rectangle"> | ||
<solid android:color="@color/primary_dark" /> | ||
</shape> | ||
</item> | ||
<item android:top="2dp"> | ||
<shape android:shape="rectangle"> | ||
<solid android:color="#FFFFFF" /> | ||
</shape> | ||
</item> | ||
</layer-list> |
Oops, something went wrong.