Android Open Source - AbLE Ab L E Test Layout2






From Project

Back to project page AbLE.

License

The source code is released under:

Apache License

If you think the Android project AbLE listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Copyright 2013 Phil Brown//ww w  .  j a  v  a  2  s  .com

   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
   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 self.philbrown.AbLETest.layout;

import self.philbrown.AbLE.AbLEActivity;
import self.philbrown.AbLE.AbLEUtil;
import self.philbrown.AbLE.annotations.Layout;
import self.philbrown.AbLETest.R;
import android.graphics.Color;
import android.graphics.Rect;
import android.view.View;

/**
 * This layout file is loaded from XML in main.xml. 
 * The layout preview will only show a blue rectangle for now.
 * @author Phil Brown
 *
 */
@Layout
public class AbLETestLayout2 
{
  public static int backgroundColor = Color.CYAN;
  
  @Layout(viewClass="android.widget.TextView")
  public static class InnerView
  {
    /**
     * The best way to set unique ids for all AbLE elements is to create the IDs in res/values/ids.xml.
     * Not using this is ok for small applications, but if any ids are used twice, there will be 
     * bugs that are difficult to trace.
     */
    public static int id = R.id.text_view;
    
    /**
     * Sets the text of this TextView.
     * @see android.widget.TextView#setText(CharSequence)
     */
    public static CharSequence text = "This is the text!";
    
    /**
     * Sets the TextView text color to white
     * @see android.widget.TextView#setTextColor(int)
     */
    public static int textColor = Color.WHITE;
    
    /**
     * Sets the view's background color
     */
    public static int backgroundColor = Color.LTGRAY;
    
    /**
     * This method is called after the view has inflated
     * @param context
     * @param v
     */
    public static void onLayoutComplete(AbLEActivity context, View v)
    {
      AbLEUtil.info("Inflated custom view");
      v.bringToFront();
      Rect r = AbLEUtil.absoluteBounds(v); 
      AbLEUtil.info("View Bounds = (%d,%d,%d,%d)", r.left, r.top, r.right, r.bottom);
    }
  }
  
  
}




Java Source Code List

self.philbrown.AbLE.AbLEActivity.java
self.philbrown.AbLE.AbLEUtil.java
self.philbrown.AbLE.ActivityListener.java
self.philbrown.AbLETest.AbLETestActivity.java
self.philbrown.AbLETest.Controller.AbLETestController.java
self.philbrown.AbLETest.Controller.package-info.java
self.philbrown.AbLETest.layout.AbLETestLayout2.java
self.philbrown.AbLETest.layout.AbLETestLayout.java
self.philbrown.AbLETest.layout.package-info.java
self.philbrown.AbLETest.package-info.java
self.philbrown.AbLE.annotations.AbstractAnnotation.java
self.philbrown.AbLE.annotations.AbstractInvisible.java
self.philbrown.AbLE.annotations.AbstractLayoutAdapter.java
self.philbrown.AbLE.annotations.AnnotatedLayoutInflater.java
self.philbrown.AbLE.annotations.Binding.java
self.philbrown.AbLE.annotations.ClassAnnotationInflater.java
self.philbrown.AbLE.annotations.EmbedInflater.java
self.philbrown.AbLE.annotations.Embed.java
self.philbrown.AbLE.annotations.FieldAnnotationInflater.java
self.philbrown.AbLE.annotations.Getter.java
self.philbrown.AbLE.annotations.InstanceMethod.java
self.philbrown.AbLE.annotations.InvisibleInflater.java
self.philbrown.AbLE.annotations.Invisible.java
self.philbrown.AbLE.annotations.LayoutAdapterInflater.java
self.philbrown.AbLE.annotations.LayoutAdapter.java
self.philbrown.AbLE.annotations.LayoutInflater.java
self.philbrown.AbLE.annotations.Layout.java
self.philbrown.AbLE.annotations.MissingAnnotationException.java
self.philbrown.AbLE.annotations.ORIENTATION.java
self.philbrown.AbLE.annotations.Setter.java
self.philbrown.AbLE.annotations.Variable.java
self.philbrown.AbLE.annotations.XMLLayoutInflater.java
self.philbrown.AbLE.annotations.XMLLayout.java
self.philbrown.AbLE.annotations.package-info.java
self.philbrown.AbLE.model.Modified.java
self.philbrown.AbLE.model.package-info.java
self.philbrown.AbLE.view.AbLE_Annotation.java
self.philbrown.AbLE.view.package-info.java
self.philbrown.AbLE.package-info.java