Example usage for android.graphics Color GRAY

List of usage examples for android.graphics Color GRAY

Introduction

In this page you can find the example usage for android.graphics Color GRAY.

Prototype

int GRAY

To view the source code for android.graphics Color GRAY.

Click Source Link

Usage

From source file:com.sonymobile.dronecontrol.activity.MainActivity.java

private void enableConnectionToParrotDevice(boolean enable) {
    ImageView drone = (ImageView) findViewById(R.id.iv_drone_connected);
    TextView text = (TextView) findViewById(R.id.tv_drone_connected);
    TextView check = (TextView) findViewById(R.id.drone_connected_check);
    if (enable) {
        text.setTextColor(getResources().getColor(R.color.DG_BLUE));
        Utils.setVisible(check);/*from  w w  w .  ja v a  2s .  co  m*/
        drone.setImageDrawable(getResources().getDrawable(R.drawable.ic_drone_setup_guide_normal));
    } else {
        text.setTextColor(Color.GRAY);
        Utils.setInvisible(check);
        drone.setImageDrawable(getResources().getDrawable(R.drawable.ic_drone_setup_guide_disabled));
    }
}

From source file:ch.teamuit.android.soundplusplus.LibraryActivity.java

/**
 * Create or recreate the limiter breadcrumbs.
 *///ww  w.j  a va  2s .  com
public void updateLimiterViews() {
    mLimiterViews.removeAllViews();

    Limiter limiterData = mPagerAdapter.getCurrentLimiter();
    if (limiterData != null) {
        String[] limiter = limiterData.names;

        LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
                LinearLayout.LayoutParams.WRAP_CONTENT);
        params.leftMargin = 5;
        for (int i = 0; i != limiter.length; ++i) {
            PaintDrawable background = new PaintDrawable(Color.GRAY);
            background.setCornerRadius(5);

            TextView view = new TextView(this);
            view.setSingleLine();
            view.setEllipsize(TextUtils.TruncateAt.MARQUEE);
            view.setText(limiter[i] + " | X");
            view.setTextColor(Color.WHITE);
            view.setBackgroundDrawable(background);
            view.setLayoutParams(params);
            view.setPadding(5, 2, 5, 2);
            view.setTag(i);
            view.setOnClickListener(this);
            mLimiterViews.addView(view);
        }

        mLimiterScroller.setVisibility(View.VISIBLE);
    } else {
        mLimiterScroller.setVisibility(View.GONE);
    }
}

From source file:com.l4digital.fastscroll.FastScroller.java

private void layout(Context context, AttributeSet attrs) {
    inflate(context, R.layout.fastscroller, this);

    setClipChildren(false);// w w  w . j  a  v a 2  s  .  c o  m
    setOrientation(HORIZONTAL);

    mBubbleView = (TextView) findViewById(R.id.fastscroll_bubble);
    mHandleView = (ImageView) findViewById(R.id.fastscroll_handle);
    mTrackView = (ImageView) findViewById(R.id.fastscroll_track);
    mScrollbar = findViewById(R.id.fastscroll_scrollbar);

    @ColorInt
    int bubbleColor = Color.GRAY;
    @ColorInt
    int handleColor = Color.DKGRAY;
    @ColorInt
    int trackColor = Color.LTGRAY;
    @ColorInt
    int textColor = Color.WHITE;

    boolean hideScrollbar = true;
    boolean showTrack = false;

    if (attrs != null) {
        TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.FastScrollRecyclerView, 0, 0);

        if (typedArray != null) {
            try {
                bubbleColor = typedArray.getColor(R.styleable.FastScrollRecyclerView_bubbleColor, bubbleColor);
                handleColor = typedArray.getColor(R.styleable.FastScrollRecyclerView_handleColor, handleColor);
                trackColor = typedArray.getColor(R.styleable.FastScrollRecyclerView_trackColor, trackColor);
                textColor = typedArray.getColor(R.styleable.FastScrollRecyclerView_bubbleTextColor, textColor);
                showTrack = typedArray.getBoolean(R.styleable.FastScrollRecyclerView_showTrack, false);
                hideScrollbar = typedArray.getBoolean(R.styleable.FastScrollRecyclerView_hideScrollbar, true);
            } finally {
                typedArray.recycle();
            }
        }
    }

    setTrackColor(trackColor);
    setHandleColor(handleColor);
    setBubbleColor(bubbleColor);
    setBubbleTextColor(textColor);
    setHideScrollbar(hideScrollbar);
    setTrackVisible(showTrack);
}

From source file:com.saulcintero.moveon.fragments.Main.java

private void disablePathColor() {
    if (pathOverlayChangeColor) {
        pathOverlay.setColor(Color.GRAY);
        pathOverlayChangeColor = false;
    }
}

From source file:co.ceryle.segmentedbutton.SegmentedButtonGroup.java

/**
 * Get attributes//ww w.  ja v a  2 s .  com
 **/
private void getAttributes(AttributeSet attrs) {
    TypedArray typedArray = getContext().obtainStyledAttributes(attrs, R.styleable.SegmentedButtonGroup);

    hasDivider = typedArray.hasValue(R.styleable.SegmentedButtonGroup_sbg_dividerSize);
    dividerSize = typedArray.getDimensionPixelSize(R.styleable.SegmentedButtonGroup_sbg_dividerSize, 0);
    dividerColor = typedArray.getColor(R.styleable.SegmentedButtonGroup_sbg_dividerColor, Color.WHITE);
    dividerPadding = typedArray.getDimensionPixelSize(R.styleable.SegmentedButtonGroup_sbg_dividerPadding, 0);
    dividerRadius = typedArray.getDimensionPixelSize(R.styleable.SegmentedButtonGroup_sbg_dividerRadius, 0);

    textColorOnSelection = typedArray.getColor(R.styleable.SegmentedButtonGroup_sbg_selectorTextColor,
            Color.GRAY);
    hasTextColorOnSelection = typedArray.hasValue(R.styleable.SegmentedButtonGroup_sbg_selectorTextColor);
    drawableTintOnSelection = typedArray.getColor(R.styleable.SegmentedButtonGroup_sbg_selectorImageTint,
            Color.GRAY);
    hasDrawableTintOnSelection = typedArray.hasValue(R.styleable.SegmentedButtonGroup_sbg_selectorImageTint);
    selectorColor = typedArray.getColor(R.styleable.SegmentedButtonGroup_sbg_selectorColor, Color.GRAY);
    animateSelector = typedArray.getInt(R.styleable.SegmentedButtonGroup_sbg_animateSelector, 0);
    animateSelectorDuration = typedArray.getInt(R.styleable.SegmentedButtonGroup_sbg_animateSelectorDuration,
            500);

    shadow = typedArray.getBoolean(R.styleable.SegmentedButtonGroup_sbg_shadow, false);
    shadowElevation = typedArray.getDimension(R.styleable.SegmentedButtonGroup_sbg_shadowElevation, 0);
    shadowMargin = typedArray.getDimensionPixelSize(R.styleable.SegmentedButtonGroup_sbg_shadowMargin, -1);
    shadowMarginTop = typedArray.getDimensionPixelSize(R.styleable.SegmentedButtonGroup_sbg_shadowMarginTop, 0);
    shadowMarginBottom = typedArray
            .getDimensionPixelSize(R.styleable.SegmentedButtonGroup_sbg_shadowMarginBottom, 0);
    shadowMarginLeft = typedArray.getDimensionPixelSize(R.styleable.SegmentedButtonGroup_sbg_shadowMarginLeft,
            0);
    shadowMarginRight = typedArray.getDimensionPixelSize(R.styleable.SegmentedButtonGroup_sbg_shadowMarginRight,
            0);

    radius = typedArray.getDimension(R.styleable.SegmentedButtonGroup_sbg_radius, 0);
    position = typedArray.getInt(R.styleable.SegmentedButtonGroup_sbg_position, 0);
    backgroundColor = typedArray.getColor(R.styleable.SegmentedButtonGroup_sbg_backgroundColor, Color.WHITE);

    ripple = typedArray.getBoolean(R.styleable.SegmentedButtonGroup_sbg_ripple, false);
    hasRippleColor = typedArray.hasValue(R.styleable.SegmentedButtonGroup_sbg_rippleColor);
    rippleColor = typedArray.getColor(R.styleable.SegmentedButtonGroup_sbg_rippleColor, Color.GRAY);

    borderSize = typedArray.getDimensionPixelSize(R.styleable.SegmentedButtonGroup_sbg_borderSize, 0);
    borderColor = typedArray.getColor(R.styleable.SegmentedButtonGroup_sbg_borderColor, Color.BLACK);

    backgroundDrawable = typedArray.getDrawable(R.styleable.SegmentedButtonGroup_sbg_backgroundDrawable);
    selectorBackgroundDrawable = typedArray
            .getDrawable(R.styleable.SegmentedButtonGroup_sbg_selectorBackgroundDrawable);
    dividerBackgroundDrawable = typedArray
            .getDrawable(R.styleable.SegmentedButtonGroup_sbg_dividerBackgroundDrawable);

    enabled = typedArray.getBoolean(R.styleable.SegmentedButtonGroup_sbg_enabled, true);

    try {
        clickable = typedArray.getBoolean(R.styleable.SegmentedButtonGroup_android_clickable, true);
    } catch (Exception ex) {
        Log.d("SegmentedButtonGroup", ex.toString());
    }

    typedArray.recycle();
}

From source file:org.huxizhijian.hhcomicviewer.ui.entry.ComicDetailsActivity.java

private void initData() {
    if (mComic == null) {
        mBinding.FABComicDetails.setBackgroundTintList(ColorStateList.valueOf(Color.GRAY));
    }/*from   w  ww  . j av  a 2s. c  om*/
    mComic = mComicDBHelper.findByCid(mCid);
    if (CommonUtils.getAPNType(this) == CommonUtils.NONEWTWORK) {
        mBinding.FABComicDetails
                .setBackgroundTintList(ColorStateList.valueOf(getResources().getColor(R.color.colorAccent)));
        Toast.makeText(this, Constants.NO_NETWORK, Toast.LENGTH_SHORT).show();
        if (mComic.getChapterName() != null) {
            mHandler.sendEmptyMessageDelayed(MSG_UPDATE_VIEW, 600);
        }
    } else {
        mPresenter = new ComicDetailsPresenter(this);
        mPresenter.getComic(mCid, mComic);
    }
    mReceiver = new ComicChapterDownloadUpdateReceiver();
}

From source file:info.bartowski.easteregg.MLand.java

public void reset() {
    L("reset");/*from   www.  j a v a2  s. c  o  m*/
    final Drawable sky = new GradientDrawable(GradientDrawable.Orientation.BOTTOM_TOP, SKIES[mTimeOfDay]);
    sky.setDither(true);
    setBackground(sky);

    mFlipped = frand() > 0.5f;
    setScaleX(mFlipped ? -1 : 1);

    int i = getChildCount();
    while (i-- > 0) {
        final View v = getChildAt(i);
        if (v instanceof GameView) {
            removeViewAt(i);
        }
    }

    mObstaclesInPlay.clear();
    mCurrentPipeId = 0;

    mWidth = getWidth();
    mHeight = getHeight();

    boolean showingSun = (mTimeOfDay == DAY || mTimeOfDay == SUNSET) && frand() > 0.25;
    if (showingSun) {
        final Star sun = new Star(getContext());
        sun.setBackground(Utility.getCompatDrawable(getContext(), R.drawable.sun));
        final int w = getResources().getDimensionPixelSize(R.dimen.mland_sun_size);
        sun.setTranslationX(frand(w, mWidth - w));
        if (mTimeOfDay == DAY) {
            sun.setTranslationY(frand(w, (mHeight * 0.66f)));
            DrawableCompat.setTint(sun.getBackground(), 0);
        } else {
            sun.setTranslationY(frand(mHeight * 0.66f, mHeight - w));
            DrawableCompat.setTintMode(sun.getBackground(), PorterDuff.Mode.SRC_ATOP);
            DrawableCompat.setTint(sun.getBackground(), 0xC0FF8000);

        }
        addView(sun, new LayoutParams(w, w));
    }
    if (!showingSun) {
        final boolean dark = mTimeOfDay == NIGHT || mTimeOfDay == TWILIGHT;
        final float ff = frand();
        if ((dark && ff < 0.75f) || ff < 0.5f) {
            final Star moon = new Star(getContext());
            moon.setBackground(Utility.getCompatDrawable(getContext(), R.drawable.moon));
            moon.getBackground().setAlpha(dark ? 255 : 128);
            moon.setScaleX(frand() > 0.5 ? -1 : 1);
            moon.setRotation(moon.getScaleX() * frand(5, 30));
            final int w = getResources().getDimensionPixelSize(R.dimen.mland_sun_size);
            moon.setTranslationX(frand(w, mWidth - w));
            moon.setTranslationY(frand(w, mHeight - w));
            addView(moon, new LayoutParams(w, w));
        }
    }

    final int mh = mHeight / 6;
    final boolean cloudless = frand() < 0.25;
    final int N = 20;
    for (i = 0; i < N; i++) {
        final float r1 = frand();
        final Scenery s;
        if (HAVE_STARS && r1 < 0.3 && mTimeOfDay != DAY) {
            s = new Star(getContext());
        } else if (r1 < 0.6 && !cloudless) {
            s = new Cloud(getContext());
        } else {
            switch (mScene) {
            case SCENE_ZRH:
                s = new Mountain(getContext());
                break;
            case SCENE_TX:
                s = new Cactus(getContext());
                break;
            case SCENE_CITY:
            default:
                s = new Building(getContext());
                break;
            }
            s.z = (float) i / N;
            // no more shadows for these things
            //s.setTranslationZ(PARAMS.SCENERY_Z * (1+s.z));
            s.v = 0.85f * s.z; // buildings move proportional to their distance
            if (mScene == SCENE_CITY) {
                s.setBackgroundColor(Color.GRAY);
                s.h = irand(PARAMS.BUILDING_HEIGHT_MIN, mh);
            }
            final int c = (int) (255f * s.z);
            final Drawable bg = s.getBackground();
            if (bg != null)
                bg.setColorFilter(Color.rgb(c, c, c), PorterDuff.Mode.MULTIPLY);
        }
        final LayoutParams lp = new LayoutParams(s.w, s.h);
        if (s instanceof Building) {
            lp.gravity = Gravity.BOTTOM;
        } else {
            lp.gravity = Gravity.TOP;
            final float r = frand();
            if (s instanceof Star) {
                lp.topMargin = (int) (r * r * mHeight);
            } else {
                lp.topMargin = (int) (1 - r * r * mHeight / 2) + mHeight / 2;
            }
        }

        addView(s, lp);
        s.setTranslationX(frand(-lp.width, mWidth + lp.width));
    }

    for (Player p : mPlayers) {
        addView(p); // put it back!
        p.reset();
    }

    realignPlayers();

    if (mAnim != null) {
        mAnim.cancel();
    }
    mAnim = new TimeAnimator();
    mAnim.setTimeListener(new TimeAnimator.TimeListener() {
        @Override
        public void onTimeUpdate(TimeAnimator timeAnimator, long t, long dt) {
            step(t, dt);
        }
    });
}

From source file:com.here.android.example.venue.Venue3dActivity.java

public void onShowRoutingPanelClick(View v) {
    int visibility = m_routeInfoLayout.getVisibility();
    if (visibility == View.VISIBLE) {
        return;//from  www  .  j  ava2 s  . c o  m
    }
    m_mainControlLayout.setVisibility(View.GONE);
    m_routeInfoLayout.setVisibility(View.VISIBLE);
    m_routingFromText.setText("");
    m_routingToText.setText("");
    m_routeStartGuideText.setTextColor(Color.WHITE);
    m_routeEndGuideText.setTextColor(Color.WHITE);

    // Don't allow to calculate a route until you set start and end destinations.
    m_showRouteButton.setBackgroundColor(Color.GRAY);
    m_showRouteButton.setClickable(false);
    startLocation = null;
    endLocation = null;
    m_is_routing_mode = true;
}

From source file:com.bookkos.bircle.CaptureActivity.java

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);

    _context = getApplicationContext();/*from  ww  w . j  ava 2  s .c  o  m*/
    _activity = this;

    currentTime = new Time("Asia/Tokyo");

    //      exceptionHandler = new ExceptionHandler(_context);   
    //      Thread.setDefaultUncaughtExceptionHandler(exceptionHandler);

    // sharedPreference???, user_id?group_id?registration_id??
    getUserData();

    Window window = getWindow();
    window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    // ??
    WindowManager window_manager = getWindowManager();
    Display display = window_manager.getDefaultDisplay();
    Point point = new Point();
    display.getSize(point);
    displayWidth = point.x;
    displayHeight = point.y;

    displayInch = getInch();
    // ??4???????
    textSize = 17 * (displayInch / 4);

    actionBar = getActionBar();
    actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE, ActionBar.DISPLAY_USE_LOGO);
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setDisplayUseLogoEnabled(false);
    actionBar.setDisplayShowHomeEnabled(false);
    actionBar.setDisplayHomeAsUpEnabled(false);
    String title_text = "";
    subGroupText = "";
    groupText = groupName;

    if (displayInch < 4.7) {
        title_text = "<small><small><small>??: </small></small></small>";
        resizeTitleSizeTooSmall();
    } else if (displayInch >= 4.7 && displayInch < 5.5) {
        title_text = "<small><small>??: </small></small>";
        resizeTitleSizeSmall();
    } else if (displayInch >= 5.5 && displayInch < 6.5) {
        title_text = "<small>??: </small>";
        resizeTitleSizeMiddle();
    } else if (displayInch >= 6.5 && displayInch < 8) {
        title_text = "<small>??: </small>";
        resizeTitleSizeLarge();
    } else {
        title_text = "??: ";
    }
    String modify_group_text = title_text + "<font color=#FF0000>" + groupName + "</font>";
    actionBar.setTitle(Html.fromHtml(modify_group_text));

    Resources resources = _context.getResources();
    int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
    titleBarHeight = resources.getDimensionPixelSize(resourceId);

    setContentView(R.layout.capture);

    returnBorrowHelpView = (ImageView) findViewById(R.id.return_borrow_help_view);
    returnBorrowHelpView.setImageResource(R.drawable.return_borrow_help);
    returnBorrowHelpView.setTranslationY(displayHeight / 5 + titleBarHeight);
    returnBorrowHelpView.setLayoutParams(new FrameLayout.LayoutParams(displayWidth,
            displayHeight / 5 + titleBarHeight, Gravity.BOTTOM | Gravity.CENTER));

    registHelpView = (ImageView) findViewById(R.id.regist_help_view);
    registHelpView.setImageResource(R.drawable.regist_help);
    registHelpView.setTranslationY(displayHeight / 5 + titleBarHeight);
    registHelpView.setLayoutParams(new FrameLayout.LayoutParams(displayWidth,
            displayHeight / 5 + titleBarHeight, Gravity.BOTTOM | Gravity.CENTER));
    registHelpView.setVisibility(View.GONE);

    leftDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    leftDrawer = (ListView) findViewById(R.id.left_drawer);
    textView = (TextView) findViewById(R.id.textView);

    modeText = (TextView) findViewById(R.id.mode_text);
    modeText.setTextColor(Color.rgb(56, 234, 123));
    modeText.setTextSize(textSize);
    modeText.setTypeface(Typeface.SERIF.MONOSPACE, Typeface.BOLD);
    strokeColor = Color.rgb(56, 234, 123);

    borrowReturnButton = (Button) findViewById(R.id.borrowReturnButton);
    registButton = (Button) findViewById(R.id.registButton);
    returnHistoryButton = (Button) findViewById(R.id.return_history_button);
    helpViewButton = (Button) findViewById(R.id.help_view_button);

    registSelectShelfRelativeLayout = (RelativeLayout) findViewById(R.id.regist_select_shelf_relative_layout);
    textViewLinearLayout = (LinearLayout) findViewById(R.id.text_view_linear_layout);
    buttonLinearLayout = (LinearLayout) findViewById(R.id.button_linear_layout);
    listViewLinearLayout = (LinearLayout) findViewById(R.id.list_view_linear_layout);
    decisionButton = (Button) findViewById(R.id.decision_button);
    cancelButton = (Button) findViewById(R.id.cancel_button);
    shelfListView = (ListView) findViewById(R.id.shelf_list_view);
    tempTextView = (TextView) findViewById(R.id.temp_text_view);
    //      bookListViewAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1);
    bookListViewAdapter = new BookListViewAdapter(_context, R.layout.book_list_row, this);

    bookRegistRelativeLayout = (RelativeLayout) findViewById(R.id.book_regist_relative_layout);
    bookRegistLinearLayout = (LinearLayout) findViewById(R.id.book_regist_linear_layout);
    bookRegistListViewLinearLayout = (LinearLayout) findViewById(R.id.book_regist_list_view_linear_layout);
    bookRegistListView = (ListView) findViewById(R.id.book_regist_list_view);
    bookRegistTextView = (TextView) findViewById(R.id.book_regist_text_view);
    bookRegistCancelButton = (Button) findViewById(R.id.book_regist_cancel_button);

    registFlag = 0;

    int borrowReturnButton_width = displayWidth / 5 * 2;
    int borrowReturnButton_height = displayHeight / 10;
    int borrowReturnButton_x = ((displayWidth / 2) - borrowReturnButton_width) / 2;
    int borrowReturnButton_y = displayHeight / 2 + titleBarHeight;
    borrowReturnButton.setTranslationX(borrowReturnButton_x);
    borrowReturnButton.setTranslationY(borrowReturnButton_y);
    borrowReturnButton
            .setLayoutParams(new FrameLayout.LayoutParams(borrowReturnButton_width, borrowReturnButton_height));
    borrowReturnButton.setBackgroundColor(Color.rgb(56, 234, 123));
    borrowReturnButton.setText("??\n");
    borrowReturnButton.setTextSize(textSize * 7 / 10);
    borrowReturnButton.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            arrayList.clear();
            registFlag = 0;

            borrowReturnButton.setText("??\n");
            borrowReturnButton.setEnabled(false);
            borrowReturnButton.setTextColor(Color.WHITE);
            borrowReturnButton.setBackgroundColor(Color.rgb(56, 234, 123));

            registButton.setText("?\n??");
            registButton.setEnabled(true);
            registButton.setTextColor(Color.GRAY);
            registButton.setBackgroundColor(Color.argb(170, 21, 38, 45));

            modeText.setText("??");
            modeText.setTextColor(Color.rgb(56, 234, 123));
            returnBorrowHelpView.setVisibility(View.VISIBLE);
            registHelpView.setVisibility(View.GONE);
            strokeColor = Color.rgb(56, 234, 123);
        }
    });

    int registButton_width = displayWidth / 5 * 2;
    int registButton_height = displayHeight / 10;
    int registButton_x = (displayWidth / 2) + ((displayWidth / 2) - registButton_width) / 2;
    int registButton_y = displayHeight / 2 + titleBarHeight;
    registButton.setTranslationX(registButton_x);
    registButton.setTranslationY(registButton_y);
    registButton.setLayoutParams(new FrameLayout.LayoutParams(registButton_width, registButton_height));
    registButton.setBackgroundColor(Color.argb(170, 21, 38, 45));
    registButton.setTextColor(Color.GRAY);
    registButton.setTextSize(textSize * 7 / 10);
    registButton.setText("?\n??");
    registButton.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            arrayList.clear();
            registFlag = 1;

            borrowReturnButton.setText("??\n??");
            borrowReturnButton.setEnabled(true);
            borrowReturnButton.setTextColor(Color.GRAY);
            borrowReturnButton.setBackgroundColor(Color.argb(170, 9, 54, 16));

            registButton.setText("?\n");
            registButton.setEnabled(false);
            registButton.setTextColor(Color.WHITE);
            registButton.setBackgroundColor(Color.rgb(62, 162, 229));

            modeText.setText("?");
            modeText.setTextColor(Color.rgb(62, 162, 229));
            returnBorrowHelpView.setVisibility(View.GONE);
            registHelpView.setVisibility(View.VISIBLE);
            strokeColor = Color.rgb(62, 162, 229);
        }
    });

    returnHistoryButton.setText("????");
    returnHistoryButton.setTextSize(textSize * 7 / 10);
    returnHistoryButton.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            leftDrawerLayout.openDrawer(Gravity.RIGHT);
            //            animateTranslationY(bookRegistRelativeLayout, displayHeight, displayHeight - displayHeight / 4 - titleBarHeight);
        }
    });
    getReturnHistory();
    getCurrentTime();

    setHelpView();
    setScanUnregisterBookView();
    setBookRegistView();

    arrayList = new ArrayList<String>();
    tempRegistIsbn = "";

    initBookRegistUrl = book_register_url + "?user_id=" + userId + "&group_id=" + groupId;
    initLendRegistUrl = lend_register_url + "?user_id=" + userId + "&group_id=" + groupId;
    initTemporaryLendRegistUrl = temporary_lend_register_url + "?user_id=" + userId + "&group_id=" + groupId;
    initCatalogRegistUrl = catalog_register_url + "?group_id=" + groupId + "&book_code=";
    initManuallyCatalogRegistUrl = manually_catalog_register_url + "?group_id=" + groupId + "&book_code=";
    getStatusUrl = get_status_url + "?group_id=" + groupId + "&user_id=" + userId;

    hasSurface = false;

    inactivityTimer = new InactivityTimer(this);
    bircleBeepManager = new BircleBeepManager(this);
    ambientLightManager = new AmbientLightManager(this);

    PreferenceManager.setDefaultValues(this, R.xml.preferences, false);

    toastText = "";
}

From source file:hu.fnf.devel.atlas.Atlas.java

private void addChilds(View parent, LinearLayout pll) {
    Uri.Builder builder = new Builder();
    builder.scheme("content");
    builder.authority(AtlasData.DB_AUTHORITY);
    builder.appendPath(AtlasData.TABLE_CATEGORIES);
    builder.appendPath("childs");
    builder.appendPath(String.valueOf(parent.getId()));

    Cursor items = getContentResolver().query(builder.build(), AtlasData.CATEGORIES_COLUMNS, null, null, null);

    if (items != null && items.moveToFirst()) {
        LinearLayout ll = null;/*from  www .j a  va  2 s.  c  o  m*/
        do {
            ll = new LinearLayout(getApplicationContext());
            LayoutParams llp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
            ll.setLayoutParams(llp);
            TextView child = new TextView(getApplicationContext());
            child.setTextAppearance(getApplicationContext(), android.R.style.TextAppearance_Medium_Inverse);

            ll.setId(items.getInt(AtlasData.CATEGORIES_ID));
            child.setId(items.getInt(AtlasData.CATEGORIES_ID));
            child.setText(items.getString(AtlasData.CATEGORIES_NAME));
            for (int i = 0; i < AtlasData.MAX_CAT_DEPTH - items.getInt(AtlasData.CATEGORIES_DEPTH); i++) {
                TextView holder = new TextView(getApplicationContext());
                holder.setText("        ");
                ll.addView(holder);
            }

            child.setClickable(true);

            Log.d("Atlas", "build to ll: " + child.getText().toString());
            ll.addView(child);

            ll.setOnClickListener(onCatClick);
            child.setOnClickListener(onCatClick);

            View line = new View(getApplicationContext());

            line.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, 1));
            line.setBackgroundColor(Color.GRAY);

            pll.addView(line);
            pll.addView(ll);
            Log.d("Atlas", "build to pll: " + ll.getId());

            addChilds(child, pll);
        } while (items.moveToNext());
        items.close();
    } else {
        // no more kids
        return;
    }
}