This file contains hidden or 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
| class ContactFinder { | |
| #db; | |
| #chatToFind; | |
| #dbName = "model-storage"; | |
| #chatsCol = "chat"; | |
| #contactCol = "contact"; | |
| #groupCol = "participant"; | |
| constructor(chatGroupName) { | |
| this.#chatToFind = chatGroupName; |
This file contains hidden or 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
| import butterknife.BindView; | |
| import butterknife.ButterKnife; | |
| import butterknife.OnClick; | |
| public class MainActivity extends Activity { | |
| @BindView(R.id.text) | |
| TextView text; | |
| @Override |
This file contains hidden or 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
| Map<TypeElement, BindingSet> bindingMap = findAndParseTargets(env); | |
| for (Map.Entry<TypeElement, BindingSet> entry : bindingMap.entrySet()) { | |
| TypeElement typeElement = entry.getKey(); | |
| BindingSet binding = entry.getValue(); | |
| JavaFile javaFile = binding.brewJava(sdk, debuggable); | |
| javaFile.writeTo(filer); | |
| } |
This file contains hidden or 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
| private Map<TypeElement, BindingSet> findAndParseTargets(RoundEnvironment env) { | |
| Map<TypeElement, BindingSet.Builder> builderMap = new LinkedHashMap<>(); | |
| ... | |
| // Process each @BindAnim element. | |
| for... | |
| ... | |
| // Process each @BindString element. | |
| for... | |
| // Process each @BindView element. | |
| for (Element element : env.getElementsAnnotatedWith(BindView.class)) { |
This file contains hidden or 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
| @Override public boolean process(Set<? extends TypeElement> elements, RoundEnvironment env) { | |
| Map<TypeElement, BindingSet> bindingMap = findAndParseTargets(env); | |
| ... |
This file contains hidden or 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
| package com.shikherverma.sampleapplication; | |
| import android.support.annotation.CallSuper; | |
| import android.support.annotation.UiThread; | |
| import android.view.View; | |
| import android.widget.TextView; | |
| import butterknife.Unbinder; | |
| import butterknife.internal.DebouncingOnClickListener; | |
| import butterknife.internal.Utils; | |
| import java.lang.IllegalStateException; |
This file contains hidden or 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
| /** | |
| * Adds a dependency to the given configuration. | |
| * | |
| * @param configurationName The name of the configuration. | |
| * @param dependencyNotation | |
| * | |
| * The dependency notation, in one of the notations described above. | |
| * @return The dependency. | |
| */ | |
| Dependency add(String configurationName, Object dependencyNotation); |
This file contains hidden or 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
| compile 'com.jakewharton:butterknife:8.8.1' | |
| annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' |
This file contains hidden or 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
| 'com.jakewharton:butterknife:8.8.1' | |
| annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' |
This file contains hidden or 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
| private static Constructor<? extends Unbinder> findBindingConstructorForClass(Class<?> cls) { | |
| Constructor<? extends Unbinder> bindingCtor = BINDINGS.get(cls); | |
| if (bindingCtor != null) { | |
| if (debug) Log.d(TAG, "HIT: Cached in binding map."); | |
| return bindingCtor; | |
| } | |
| String clsName = cls.getName(); | |
| if (clsName.startsWith("android.") || clsName.startsWith("java.")) { | |
| if (debug) Log.d(TAG, "MISS: Reached framework class. Abandoning search."); | |
| return null; |
NewerOlder