1. Are you ready for the Galaxy S20? Here is everything we know so far!

Help inserting clock into app

Discussion in 'Android Development' started by AtoZ0to9, Sep 5, 2021.

  1. AtoZ0to9

    AtoZ0to9 Lurker
    Thread Starter

    Hello! New user here. I was wondering if someone smarter than me might be able to help me out. I use an app called Channels DVR for TV / DVR. It only comes in purple, so I decompiled the APK and created my own theme, and am happy with it. Now I would like to insert a clock in place of the logo, but the problem is I'm pretty stupid, and am having trouble figuring it out. I've been trying to insert code for TextClock, or Digital clock, but am obviously not doing it right, because the app crashes after changing that code.

    Here's the logo I'm trying to replace:

    Code (Text):
    1. https://drive.google.com/file/d/13w5CMRCbkGfMy-2wzBRLjAsFU1yp3y_D/view?usp=drivesdk
    Here is the original code for the sidebar:

    Code (Text):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <com.getchannels.android.ui.SideBar android:background="@color/background" android:layout_width="@dimen/sidebar_closed_width" android:layout_height="fill_parent"
    3.   xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
    4.     <androidx.constraintlayout.widget.Guideline android:orientation="vertical" android:id="@id/sidebar_guideline" android:layout_width="wrap_content" android:layout_height="wrap_content" app:layout_constraintGuide_begin="@dimen/sidebar_closed_width" />
    5.     <androidx.constraintlayout.widget.Guideline android:orientation="vertical" android:id="@id/sidebar_expanded_guideline" android:layout_width="wrap_content" android:layout_height="wrap_content" app:layout_constraintGuide_begin="@dimen/sidebar_open_width" />
    6.     <ImageView android:id="@id/sidebar_logo" android:layout_width="70.0dip" android:layout_height="42.0dip" android:layout_marginTop="35.0dip" android:src="@drawable/logo" android:adjustViewBounds="true" android:alpha="0.0" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toLeftOf="@id/sidebar_expanded_guideline" app:layout_constraintTop_toTopOf="parent" />
    7.     <LinearLayout android:orientation="vertical" android:id="@id/sidebar_items" android:layout_width="0.0dip" android:layout_height="wrap_content" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="@id/sidebar_expanded_guideline" app:layout_constraintTop_toTopOf="parent">
    8.         <include android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="16.0dip" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" layout="@layout/sidebar_button" />
    9.         <include android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="16.0dip" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" layout="@layout/sidebar_button" />
    10.         <include android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="16.0dip" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" layout="@layout/sidebar_button" />
    11.     </LinearLayout>
    12.     <include android:id
    And the code for the logo:

    Code (Text):
    1.  
    2. <ImageView android:id="@id/sidebar_logo" android:layout_width="70.0dip" android:layout_height="42.0dip" android:layout_marginTop="35.0dip" android:src="@drawable/logo" android:adjustViewBounds="true" android:alpha="0.0" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toLeftOf="@id/sidebar_expanded_guideline" app:layout_constraintTop_toTopOf="parent" />
    Any ideas?
    Thanks
     


    #1 AtoZ0to9, Sep 5, 2021
    Last edited: Sep 5, 2021

    1. Download the Forums for Android™ app!


      Download

       
  2. AtoZ0to9

    AtoZ0to9 Lurker
    Thread Starter

    I can't seem to get the image to show up, so I put it in a code box...
     
Loading...

Share This Page

Loading...