resource linking failed for ids and public











up vote
1
down vote

favorite












I am trying to create dimens xml, ids xml and public xml for android studio so I can have id so I can call in every layout xml I need because I dont need to write the same cocde again and again.
But this is making me confuse because it shows no error in the declared xmls but the build gradle it is not working.
I have Invalide Caches and Restart but didn't work.
And please if I didn't write something good to code let me know.



This is my code.
activity_main



<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/container"
style="@style/ActivityMain">
<LinearLayout android:id="@+id/linLayoutMainSearch" style="LinearLayoutSearch">
<LinearLayout android:id="@id/linearLayoutOutsideSearch" style="@style/LinearLayoutOutsideSearch.Search">
<LinearLayout style="@style/LinearLayoutInsideSearch">
<LinearLayout android:orientation="horizontal" android:id="@id/linLayoutAutoFocus" style="@style/LinearLayoutAutoFocus" />
<FrameLayout android:layout_gravity="center_vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1.0">
<EditText android:id="@id/etSearch" android:imeOptions="actionGo|flagNoExtractUi" style="@style/SearchEditText.MainSearch" />
<LinearLayout android:orientation="vertical" android:id="@id/layoutWithFakeCursor" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content">
<ImageView android:id="@id/ivCursor" android:background="@drawable/kursor" android:layout_width="2.0dip" android:layout_height="20.0dip" android:layout_marginLeft="6.0dip" />
</LinearLayout>
</FrameLayout>
<ImageButton android:layout_gravity="center" android:id="@id/imgBtnBookmark" android:background="@drawable/selector_gray_btn" android:paddingTop="3.0dip" android:paddingRight="7.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_reading_list" android:scaleType="center" android:scaleX="0.8" android:scaleY="0.8" />
<ImageButton android:id="@id/btnClearSearch" style="@style/ImageButtonClose" />
</LinearLayout>
<Button android:id="@id/btnSearch" style="@style/ButtonSearch" />
<ImageView android:id="@id/imgBtnHome" style="@style/ImageViewHome" />
</LinearLayout>
</LinearLayout>

</RelativeLayout>


ids.xml



<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="upDivider" type="id">false</item>
<item name="linLayoutMainSearch" type="id">false</item>
<item name="linLayoutAutoFocus" type="id">false</item>
<item name="linearLayoutOutsideSearch" type="id">false</item>
<item name="etSearch" type="id">false</item>
<item name="layoutWithFakeCursor" type="id">false</item>
<item name="ivCursor" type="id">false</item>
<item name="imgBtnBookmark" type="id">false</item>
<item name="btnClearSearch" type="id">false</item>
<item name="btnSearch" type="id">false</item>
<item name="imgBtnHome" type="id">false</item>
</resources>


public.xml



<resources>
<public name="imgBtnHome" id="0x7f0b0089" type="id" />
<public name="btnSearch" id="0x7f0b0088" type="id" />
<public name="btnClearSearch" id="0x7f0b0087" type="id" />
<public type="id" name="imgBtnBookmark" id="0x7f0b0086" />
<public type="id" name="ivCursor" id="0x7f0b0085" />
<public type="id" name="layoutWithFakeCursor" id="0x7f0b0084" />
<public type="id" name="etSearch" id="0x7f0b0083" />
<public type="style" name="LinearLayoutOutsideSearch" id="0x7f08011d" />
<public type="id" name="linLayoutAutoFocus" id="0x7f0b0082" />
<public type="id" name="linLayoutMainSearch" id="0x7f0b0080" />
<public type="id" name="upDivider" id="0x7f0b009b" />

</resources>


dimens.xml



<resources>
<dimen name="search_height">42dp</dimen>
<dimen name="search_font">15sp</dimen>
</resources>


styles.xml



<resource>
<!-- <style name="ImageViewHome">
<item name="android:layout_gravity">center</item>
<item name="android:background">@drawable/selector_gray_btn</item>
<item name="android:paddingLeft">4.0dip</item>
<item name="android:paddingTop">4.0dip</item>
<item name="android:paddingBottom">4.0dip</item>
<item name="android:layout_width">37.0dip</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:src">@drawable/ic_home_button</item>
<item name="android:scaleType">fitCenter</item>
</style>

<style name="ActivityMain">
<item name="android:background">@android:color/white</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>

</style>
<style name="LinearLayoutSearch">
<item name="android:orientation">vertical</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:layout_below">@id/upDivider</item>
</style>
<style name="LinearLayoutInsideSearch">
<item name="android:layout_gravity">center</item>
<item name="android:orientation">horizontal</item>
<item name="android:background">@android:color/white</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">35.0dip</item>
<item name="android:layout_marginLeft">2.0dip</item>
<item name="android:layout_weight">1.0</item>
</style>
<style name="LinearLayoutAutoFocus">
<item name="android:focusable">true</item>
<item name="android:focusableInTouchMode">true</item>
<item name="android:layout_width">0.0dip</item>
<item name="android:layout_height">0.0dip</item>
</style>
<style name="LinearLayoutOutsideSearch.Search" parent="@style/LinearLayoutOutsideSearch">
<item name="android:paddingRight">7.0dip</item>
</style>
<style name="LinearLayoutOutsideSearch">
<item name="android:orientation">horizontal</item>
<item name="android:background">@android:color/white</item>
<item name="android:paddingLeft">3.0dip</item>
<item name="android:paddingTop">3.0dip</item>
<item name="android:paddingRight">3.0dip</item>
<item name="android:paddingBottom">3.0dip</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">@dimen/search_height</item>
</style>
<style name="SearchEditText" parent="@android:style/Widget.EditText">
<item name="android:buttonStyle">@style/LowerCaseTextBtn</item>
<item name="android:textSize">@dimen/search_font</item>
<item name="android:textColor">@android:color/black</item>
<item name="android:textColorHighlight">@color/edit_text_color_highlight</item>
<item name="android:textColorHint">@color/gray</item>
<item name="android:gravity">center_vertical</item>
<item name="android:layout_gravity">center</item>
<item name="android:background">@android:color/transparent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:layout_weight">1.0</item>
<item name="android:textCursorDrawable">@drawable/edit_text_cursor</item>
</style>
<style name="SearchEditText.MainSearch" parent="@style/SearchEditText">
<item name="android:paddingLeft">6.0dip</item>
<item name="android:hint">@string/SVSearchTextFieldPlaceholder</item>
<item name="android:imeOptions">actionGo</item>

</style>
<style name="LowerCaseTextBtn" parent="@android:style/Widget">
<item name="android:textStyle">normal</item>
<item name="android:textAllCaps">false</item>
</style>
<style name="ImageButtonClose">
<item name="android:layout_gravity">center|right</item>
<item name="android:background">@android:color/transparent</item>
<item name="android:paddingLeft">7.0dip</item>
<item name="android:paddingTop">6.0dip</item>
<item name="android:paddingRight">12.0dip</item>
<item name="android:paddingBottom">5.0dip</item>
<item name="android:visibility">gone</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:src">@drawable/ic_close</item>
</style>
<style name="ButtonSearch" parent="@style/LowerCaseTextBtn">
<item name="android:textSize">15.0sp</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">@color/urlSuggest</item>
<item name="android:gravity">center</item>
<item name="android:layout_gravity">center</item>
<item name="android:background">@drawable/selector_gray_btn</item>
<item name="android:visibility">gone</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:text">@string/SVSearchButton</item>
</style>-->
</resource>









share|improve this question




























    up vote
    1
    down vote

    favorite












    I am trying to create dimens xml, ids xml and public xml for android studio so I can have id so I can call in every layout xml I need because I dont need to write the same cocde again and again.
    But this is making me confuse because it shows no error in the declared xmls but the build gradle it is not working.
    I have Invalide Caches and Restart but didn't work.
    And please if I didn't write something good to code let me know.



    This is my code.
    activity_main



    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/container"
    style="@style/ActivityMain">
    <LinearLayout android:id="@+id/linLayoutMainSearch" style="LinearLayoutSearch">
    <LinearLayout android:id="@id/linearLayoutOutsideSearch" style="@style/LinearLayoutOutsideSearch.Search">
    <LinearLayout style="@style/LinearLayoutInsideSearch">
    <LinearLayout android:orientation="horizontal" android:id="@id/linLayoutAutoFocus" style="@style/LinearLayoutAutoFocus" />
    <FrameLayout android:layout_gravity="center_vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1.0">
    <EditText android:id="@id/etSearch" android:imeOptions="actionGo|flagNoExtractUi" style="@style/SearchEditText.MainSearch" />
    <LinearLayout android:orientation="vertical" android:id="@id/layoutWithFakeCursor" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content">
    <ImageView android:id="@id/ivCursor" android:background="@drawable/kursor" android:layout_width="2.0dip" android:layout_height="20.0dip" android:layout_marginLeft="6.0dip" />
    </LinearLayout>
    </FrameLayout>
    <ImageButton android:layout_gravity="center" android:id="@id/imgBtnBookmark" android:background="@drawable/selector_gray_btn" android:paddingTop="3.0dip" android:paddingRight="7.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_reading_list" android:scaleType="center" android:scaleX="0.8" android:scaleY="0.8" />
    <ImageButton android:id="@id/btnClearSearch" style="@style/ImageButtonClose" />
    </LinearLayout>
    <Button android:id="@id/btnSearch" style="@style/ButtonSearch" />
    <ImageView android:id="@id/imgBtnHome" style="@style/ImageViewHome" />
    </LinearLayout>
    </LinearLayout>

    </RelativeLayout>


    ids.xml



    <?xml version="1.0" encoding="utf-8"?>
    <resources>
    <item name="upDivider" type="id">false</item>
    <item name="linLayoutMainSearch" type="id">false</item>
    <item name="linLayoutAutoFocus" type="id">false</item>
    <item name="linearLayoutOutsideSearch" type="id">false</item>
    <item name="etSearch" type="id">false</item>
    <item name="layoutWithFakeCursor" type="id">false</item>
    <item name="ivCursor" type="id">false</item>
    <item name="imgBtnBookmark" type="id">false</item>
    <item name="btnClearSearch" type="id">false</item>
    <item name="btnSearch" type="id">false</item>
    <item name="imgBtnHome" type="id">false</item>
    </resources>


    public.xml



    <resources>
    <public name="imgBtnHome" id="0x7f0b0089" type="id" />
    <public name="btnSearch" id="0x7f0b0088" type="id" />
    <public name="btnClearSearch" id="0x7f0b0087" type="id" />
    <public type="id" name="imgBtnBookmark" id="0x7f0b0086" />
    <public type="id" name="ivCursor" id="0x7f0b0085" />
    <public type="id" name="layoutWithFakeCursor" id="0x7f0b0084" />
    <public type="id" name="etSearch" id="0x7f0b0083" />
    <public type="style" name="LinearLayoutOutsideSearch" id="0x7f08011d" />
    <public type="id" name="linLayoutAutoFocus" id="0x7f0b0082" />
    <public type="id" name="linLayoutMainSearch" id="0x7f0b0080" />
    <public type="id" name="upDivider" id="0x7f0b009b" />

    </resources>


    dimens.xml



    <resources>
    <dimen name="search_height">42dp</dimen>
    <dimen name="search_font">15sp</dimen>
    </resources>


    styles.xml



    <resource>
    <!-- <style name="ImageViewHome">
    <item name="android:layout_gravity">center</item>
    <item name="android:background">@drawable/selector_gray_btn</item>
    <item name="android:paddingLeft">4.0dip</item>
    <item name="android:paddingTop">4.0dip</item>
    <item name="android:paddingBottom">4.0dip</item>
    <item name="android:layout_width">37.0dip</item>
    <item name="android:layout_height">wrap_content</item>
    <item name="android:src">@drawable/ic_home_button</item>
    <item name="android:scaleType">fitCenter</item>
    </style>

    <style name="ActivityMain">
    <item name="android:background">@android:color/white</item>
    <item name="android:layout_width">fill_parent</item>
    <item name="android:layout_height">fill_parent</item>

    </style>
    <style name="LinearLayoutSearch">
    <item name="android:orientation">vertical</item>
    <item name="android:layout_width">fill_parent</item>
    <item name="android:layout_height">fill_parent</item>
    <item name="android:layout_below">@id/upDivider</item>
    </style>
    <style name="LinearLayoutInsideSearch">
    <item name="android:layout_gravity">center</item>
    <item name="android:orientation">horizontal</item>
    <item name="android:background">@android:color/white</item>
    <item name="android:layout_width">fill_parent</item>
    <item name="android:layout_height">35.0dip</item>
    <item name="android:layout_marginLeft">2.0dip</item>
    <item name="android:layout_weight">1.0</item>
    </style>
    <style name="LinearLayoutAutoFocus">
    <item name="android:focusable">true</item>
    <item name="android:focusableInTouchMode">true</item>
    <item name="android:layout_width">0.0dip</item>
    <item name="android:layout_height">0.0dip</item>
    </style>
    <style name="LinearLayoutOutsideSearch.Search" parent="@style/LinearLayoutOutsideSearch">
    <item name="android:paddingRight">7.0dip</item>
    </style>
    <style name="LinearLayoutOutsideSearch">
    <item name="android:orientation">horizontal</item>
    <item name="android:background">@android:color/white</item>
    <item name="android:paddingLeft">3.0dip</item>
    <item name="android:paddingTop">3.0dip</item>
    <item name="android:paddingRight">3.0dip</item>
    <item name="android:paddingBottom">3.0dip</item>
    <item name="android:layout_width">fill_parent</item>
    <item name="android:layout_height">@dimen/search_height</item>
    </style>
    <style name="SearchEditText" parent="@android:style/Widget.EditText">
    <item name="android:buttonStyle">@style/LowerCaseTextBtn</item>
    <item name="android:textSize">@dimen/search_font</item>
    <item name="android:textColor">@android:color/black</item>
    <item name="android:textColorHighlight">@color/edit_text_color_highlight</item>
    <item name="android:textColorHint">@color/gray</item>
    <item name="android:gravity">center_vertical</item>
    <item name="android:layout_gravity">center</item>
    <item name="android:background">@android:color/transparent</item>
    <item name="android:layout_width">fill_parent</item>
    <item name="android:layout_height">fill_parent</item>
    <item name="android:layout_weight">1.0</item>
    <item name="android:textCursorDrawable">@drawable/edit_text_cursor</item>
    </style>
    <style name="SearchEditText.MainSearch" parent="@style/SearchEditText">
    <item name="android:paddingLeft">6.0dip</item>
    <item name="android:hint">@string/SVSearchTextFieldPlaceholder</item>
    <item name="android:imeOptions">actionGo</item>

    </style>
    <style name="LowerCaseTextBtn" parent="@android:style/Widget">
    <item name="android:textStyle">normal</item>
    <item name="android:textAllCaps">false</item>
    </style>
    <style name="ImageButtonClose">
    <item name="android:layout_gravity">center|right</item>
    <item name="android:background">@android:color/transparent</item>
    <item name="android:paddingLeft">7.0dip</item>
    <item name="android:paddingTop">6.0dip</item>
    <item name="android:paddingRight">12.0dip</item>
    <item name="android:paddingBottom">5.0dip</item>
    <item name="android:visibility">gone</item>
    <item name="android:layout_width">wrap_content</item>
    <item name="android:layout_height">fill_parent</item>
    <item name="android:src">@drawable/ic_close</item>
    </style>
    <style name="ButtonSearch" parent="@style/LowerCaseTextBtn">
    <item name="android:textSize">15.0sp</item>
    <item name="android:textStyle">bold</item>
    <item name="android:textColor">@color/urlSuggest</item>
    <item name="android:gravity">center</item>
    <item name="android:layout_gravity">center</item>
    <item name="android:background">@drawable/selector_gray_btn</item>
    <item name="android:visibility">gone</item>
    <item name="android:layout_width">wrap_content</item>
    <item name="android:layout_height">wrap_content</item>
    <item name="android:text">@string/SVSearchButton</item>
    </style>-->
    </resource>









    share|improve this question


























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I am trying to create dimens xml, ids xml and public xml for android studio so I can have id so I can call in every layout xml I need because I dont need to write the same cocde again and again.
      But this is making me confuse because it shows no error in the declared xmls but the build gradle it is not working.
      I have Invalide Caches and Restart but didn't work.
      And please if I didn't write something good to code let me know.



      This is my code.
      activity_main



      <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/container"
      style="@style/ActivityMain">
      <LinearLayout android:id="@+id/linLayoutMainSearch" style="LinearLayoutSearch">
      <LinearLayout android:id="@id/linearLayoutOutsideSearch" style="@style/LinearLayoutOutsideSearch.Search">
      <LinearLayout style="@style/LinearLayoutInsideSearch">
      <LinearLayout android:orientation="horizontal" android:id="@id/linLayoutAutoFocus" style="@style/LinearLayoutAutoFocus" />
      <FrameLayout android:layout_gravity="center_vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1.0">
      <EditText android:id="@id/etSearch" android:imeOptions="actionGo|flagNoExtractUi" style="@style/SearchEditText.MainSearch" />
      <LinearLayout android:orientation="vertical" android:id="@id/layoutWithFakeCursor" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content">
      <ImageView android:id="@id/ivCursor" android:background="@drawable/kursor" android:layout_width="2.0dip" android:layout_height="20.0dip" android:layout_marginLeft="6.0dip" />
      </LinearLayout>
      </FrameLayout>
      <ImageButton android:layout_gravity="center" android:id="@id/imgBtnBookmark" android:background="@drawable/selector_gray_btn" android:paddingTop="3.0dip" android:paddingRight="7.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_reading_list" android:scaleType="center" android:scaleX="0.8" android:scaleY="0.8" />
      <ImageButton android:id="@id/btnClearSearch" style="@style/ImageButtonClose" />
      </LinearLayout>
      <Button android:id="@id/btnSearch" style="@style/ButtonSearch" />
      <ImageView android:id="@id/imgBtnHome" style="@style/ImageViewHome" />
      </LinearLayout>
      </LinearLayout>

      </RelativeLayout>


      ids.xml



      <?xml version="1.0" encoding="utf-8"?>
      <resources>
      <item name="upDivider" type="id">false</item>
      <item name="linLayoutMainSearch" type="id">false</item>
      <item name="linLayoutAutoFocus" type="id">false</item>
      <item name="linearLayoutOutsideSearch" type="id">false</item>
      <item name="etSearch" type="id">false</item>
      <item name="layoutWithFakeCursor" type="id">false</item>
      <item name="ivCursor" type="id">false</item>
      <item name="imgBtnBookmark" type="id">false</item>
      <item name="btnClearSearch" type="id">false</item>
      <item name="btnSearch" type="id">false</item>
      <item name="imgBtnHome" type="id">false</item>
      </resources>


      public.xml



      <resources>
      <public name="imgBtnHome" id="0x7f0b0089" type="id" />
      <public name="btnSearch" id="0x7f0b0088" type="id" />
      <public name="btnClearSearch" id="0x7f0b0087" type="id" />
      <public type="id" name="imgBtnBookmark" id="0x7f0b0086" />
      <public type="id" name="ivCursor" id="0x7f0b0085" />
      <public type="id" name="layoutWithFakeCursor" id="0x7f0b0084" />
      <public type="id" name="etSearch" id="0x7f0b0083" />
      <public type="style" name="LinearLayoutOutsideSearch" id="0x7f08011d" />
      <public type="id" name="linLayoutAutoFocus" id="0x7f0b0082" />
      <public type="id" name="linLayoutMainSearch" id="0x7f0b0080" />
      <public type="id" name="upDivider" id="0x7f0b009b" />

      </resources>


      dimens.xml



      <resources>
      <dimen name="search_height">42dp</dimen>
      <dimen name="search_font">15sp</dimen>
      </resources>


      styles.xml



      <resource>
      <!-- <style name="ImageViewHome">
      <item name="android:layout_gravity">center</item>
      <item name="android:background">@drawable/selector_gray_btn</item>
      <item name="android:paddingLeft">4.0dip</item>
      <item name="android:paddingTop">4.0dip</item>
      <item name="android:paddingBottom">4.0dip</item>
      <item name="android:layout_width">37.0dip</item>
      <item name="android:layout_height">wrap_content</item>
      <item name="android:src">@drawable/ic_home_button</item>
      <item name="android:scaleType">fitCenter</item>
      </style>

      <style name="ActivityMain">
      <item name="android:background">@android:color/white</item>
      <item name="android:layout_width">fill_parent</item>
      <item name="android:layout_height">fill_parent</item>

      </style>
      <style name="LinearLayoutSearch">
      <item name="android:orientation">vertical</item>
      <item name="android:layout_width">fill_parent</item>
      <item name="android:layout_height">fill_parent</item>
      <item name="android:layout_below">@id/upDivider</item>
      </style>
      <style name="LinearLayoutInsideSearch">
      <item name="android:layout_gravity">center</item>
      <item name="android:orientation">horizontal</item>
      <item name="android:background">@android:color/white</item>
      <item name="android:layout_width">fill_parent</item>
      <item name="android:layout_height">35.0dip</item>
      <item name="android:layout_marginLeft">2.0dip</item>
      <item name="android:layout_weight">1.0</item>
      </style>
      <style name="LinearLayoutAutoFocus">
      <item name="android:focusable">true</item>
      <item name="android:focusableInTouchMode">true</item>
      <item name="android:layout_width">0.0dip</item>
      <item name="android:layout_height">0.0dip</item>
      </style>
      <style name="LinearLayoutOutsideSearch.Search" parent="@style/LinearLayoutOutsideSearch">
      <item name="android:paddingRight">7.0dip</item>
      </style>
      <style name="LinearLayoutOutsideSearch">
      <item name="android:orientation">horizontal</item>
      <item name="android:background">@android:color/white</item>
      <item name="android:paddingLeft">3.0dip</item>
      <item name="android:paddingTop">3.0dip</item>
      <item name="android:paddingRight">3.0dip</item>
      <item name="android:paddingBottom">3.0dip</item>
      <item name="android:layout_width">fill_parent</item>
      <item name="android:layout_height">@dimen/search_height</item>
      </style>
      <style name="SearchEditText" parent="@android:style/Widget.EditText">
      <item name="android:buttonStyle">@style/LowerCaseTextBtn</item>
      <item name="android:textSize">@dimen/search_font</item>
      <item name="android:textColor">@android:color/black</item>
      <item name="android:textColorHighlight">@color/edit_text_color_highlight</item>
      <item name="android:textColorHint">@color/gray</item>
      <item name="android:gravity">center_vertical</item>
      <item name="android:layout_gravity">center</item>
      <item name="android:background">@android:color/transparent</item>
      <item name="android:layout_width">fill_parent</item>
      <item name="android:layout_height">fill_parent</item>
      <item name="android:layout_weight">1.0</item>
      <item name="android:textCursorDrawable">@drawable/edit_text_cursor</item>
      </style>
      <style name="SearchEditText.MainSearch" parent="@style/SearchEditText">
      <item name="android:paddingLeft">6.0dip</item>
      <item name="android:hint">@string/SVSearchTextFieldPlaceholder</item>
      <item name="android:imeOptions">actionGo</item>

      </style>
      <style name="LowerCaseTextBtn" parent="@android:style/Widget">
      <item name="android:textStyle">normal</item>
      <item name="android:textAllCaps">false</item>
      </style>
      <style name="ImageButtonClose">
      <item name="android:layout_gravity">center|right</item>
      <item name="android:background">@android:color/transparent</item>
      <item name="android:paddingLeft">7.0dip</item>
      <item name="android:paddingTop">6.0dip</item>
      <item name="android:paddingRight">12.0dip</item>
      <item name="android:paddingBottom">5.0dip</item>
      <item name="android:visibility">gone</item>
      <item name="android:layout_width">wrap_content</item>
      <item name="android:layout_height">fill_parent</item>
      <item name="android:src">@drawable/ic_close</item>
      </style>
      <style name="ButtonSearch" parent="@style/LowerCaseTextBtn">
      <item name="android:textSize">15.0sp</item>
      <item name="android:textStyle">bold</item>
      <item name="android:textColor">@color/urlSuggest</item>
      <item name="android:gravity">center</item>
      <item name="android:layout_gravity">center</item>
      <item name="android:background">@drawable/selector_gray_btn</item>
      <item name="android:visibility">gone</item>
      <item name="android:layout_width">wrap_content</item>
      <item name="android:layout_height">wrap_content</item>
      <item name="android:text">@string/SVSearchButton</item>
      </style>-->
      </resource>









      share|improve this question















      I am trying to create dimens xml, ids xml and public xml for android studio so I can have id so I can call in every layout xml I need because I dont need to write the same cocde again and again.
      But this is making me confuse because it shows no error in the declared xmls but the build gradle it is not working.
      I have Invalide Caches and Restart but didn't work.
      And please if I didn't write something good to code let me know.



      This is my code.
      activity_main



      <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/container"
      style="@style/ActivityMain">
      <LinearLayout android:id="@+id/linLayoutMainSearch" style="LinearLayoutSearch">
      <LinearLayout android:id="@id/linearLayoutOutsideSearch" style="@style/LinearLayoutOutsideSearch.Search">
      <LinearLayout style="@style/LinearLayoutInsideSearch">
      <LinearLayout android:orientation="horizontal" android:id="@id/linLayoutAutoFocus" style="@style/LinearLayoutAutoFocus" />
      <FrameLayout android:layout_gravity="center_vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1.0">
      <EditText android:id="@id/etSearch" android:imeOptions="actionGo|flagNoExtractUi" style="@style/SearchEditText.MainSearch" />
      <LinearLayout android:orientation="vertical" android:id="@id/layoutWithFakeCursor" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content">
      <ImageView android:id="@id/ivCursor" android:background="@drawable/kursor" android:layout_width="2.0dip" android:layout_height="20.0dip" android:layout_marginLeft="6.0dip" />
      </LinearLayout>
      </FrameLayout>
      <ImageButton android:layout_gravity="center" android:id="@id/imgBtnBookmark" android:background="@drawable/selector_gray_btn" android:paddingTop="3.0dip" android:paddingRight="7.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_reading_list" android:scaleType="center" android:scaleX="0.8" android:scaleY="0.8" />
      <ImageButton android:id="@id/btnClearSearch" style="@style/ImageButtonClose" />
      </LinearLayout>
      <Button android:id="@id/btnSearch" style="@style/ButtonSearch" />
      <ImageView android:id="@id/imgBtnHome" style="@style/ImageViewHome" />
      </LinearLayout>
      </LinearLayout>

      </RelativeLayout>


      ids.xml



      <?xml version="1.0" encoding="utf-8"?>
      <resources>
      <item name="upDivider" type="id">false</item>
      <item name="linLayoutMainSearch" type="id">false</item>
      <item name="linLayoutAutoFocus" type="id">false</item>
      <item name="linearLayoutOutsideSearch" type="id">false</item>
      <item name="etSearch" type="id">false</item>
      <item name="layoutWithFakeCursor" type="id">false</item>
      <item name="ivCursor" type="id">false</item>
      <item name="imgBtnBookmark" type="id">false</item>
      <item name="btnClearSearch" type="id">false</item>
      <item name="btnSearch" type="id">false</item>
      <item name="imgBtnHome" type="id">false</item>
      </resources>


      public.xml



      <resources>
      <public name="imgBtnHome" id="0x7f0b0089" type="id" />
      <public name="btnSearch" id="0x7f0b0088" type="id" />
      <public name="btnClearSearch" id="0x7f0b0087" type="id" />
      <public type="id" name="imgBtnBookmark" id="0x7f0b0086" />
      <public type="id" name="ivCursor" id="0x7f0b0085" />
      <public type="id" name="layoutWithFakeCursor" id="0x7f0b0084" />
      <public type="id" name="etSearch" id="0x7f0b0083" />
      <public type="style" name="LinearLayoutOutsideSearch" id="0x7f08011d" />
      <public type="id" name="linLayoutAutoFocus" id="0x7f0b0082" />
      <public type="id" name="linLayoutMainSearch" id="0x7f0b0080" />
      <public type="id" name="upDivider" id="0x7f0b009b" />

      </resources>


      dimens.xml



      <resources>
      <dimen name="search_height">42dp</dimen>
      <dimen name="search_font">15sp</dimen>
      </resources>


      styles.xml



      <resource>
      <!-- <style name="ImageViewHome">
      <item name="android:layout_gravity">center</item>
      <item name="android:background">@drawable/selector_gray_btn</item>
      <item name="android:paddingLeft">4.0dip</item>
      <item name="android:paddingTop">4.0dip</item>
      <item name="android:paddingBottom">4.0dip</item>
      <item name="android:layout_width">37.0dip</item>
      <item name="android:layout_height">wrap_content</item>
      <item name="android:src">@drawable/ic_home_button</item>
      <item name="android:scaleType">fitCenter</item>
      </style>

      <style name="ActivityMain">
      <item name="android:background">@android:color/white</item>
      <item name="android:layout_width">fill_parent</item>
      <item name="android:layout_height">fill_parent</item>

      </style>
      <style name="LinearLayoutSearch">
      <item name="android:orientation">vertical</item>
      <item name="android:layout_width">fill_parent</item>
      <item name="android:layout_height">fill_parent</item>
      <item name="android:layout_below">@id/upDivider</item>
      </style>
      <style name="LinearLayoutInsideSearch">
      <item name="android:layout_gravity">center</item>
      <item name="android:orientation">horizontal</item>
      <item name="android:background">@android:color/white</item>
      <item name="android:layout_width">fill_parent</item>
      <item name="android:layout_height">35.0dip</item>
      <item name="android:layout_marginLeft">2.0dip</item>
      <item name="android:layout_weight">1.0</item>
      </style>
      <style name="LinearLayoutAutoFocus">
      <item name="android:focusable">true</item>
      <item name="android:focusableInTouchMode">true</item>
      <item name="android:layout_width">0.0dip</item>
      <item name="android:layout_height">0.0dip</item>
      </style>
      <style name="LinearLayoutOutsideSearch.Search" parent="@style/LinearLayoutOutsideSearch">
      <item name="android:paddingRight">7.0dip</item>
      </style>
      <style name="LinearLayoutOutsideSearch">
      <item name="android:orientation">horizontal</item>
      <item name="android:background">@android:color/white</item>
      <item name="android:paddingLeft">3.0dip</item>
      <item name="android:paddingTop">3.0dip</item>
      <item name="android:paddingRight">3.0dip</item>
      <item name="android:paddingBottom">3.0dip</item>
      <item name="android:layout_width">fill_parent</item>
      <item name="android:layout_height">@dimen/search_height</item>
      </style>
      <style name="SearchEditText" parent="@android:style/Widget.EditText">
      <item name="android:buttonStyle">@style/LowerCaseTextBtn</item>
      <item name="android:textSize">@dimen/search_font</item>
      <item name="android:textColor">@android:color/black</item>
      <item name="android:textColorHighlight">@color/edit_text_color_highlight</item>
      <item name="android:textColorHint">@color/gray</item>
      <item name="android:gravity">center_vertical</item>
      <item name="android:layout_gravity">center</item>
      <item name="android:background">@android:color/transparent</item>
      <item name="android:layout_width">fill_parent</item>
      <item name="android:layout_height">fill_parent</item>
      <item name="android:layout_weight">1.0</item>
      <item name="android:textCursorDrawable">@drawable/edit_text_cursor</item>
      </style>
      <style name="SearchEditText.MainSearch" parent="@style/SearchEditText">
      <item name="android:paddingLeft">6.0dip</item>
      <item name="android:hint">@string/SVSearchTextFieldPlaceholder</item>
      <item name="android:imeOptions">actionGo</item>

      </style>
      <style name="LowerCaseTextBtn" parent="@android:style/Widget">
      <item name="android:textStyle">normal</item>
      <item name="android:textAllCaps">false</item>
      </style>
      <style name="ImageButtonClose">
      <item name="android:layout_gravity">center|right</item>
      <item name="android:background">@android:color/transparent</item>
      <item name="android:paddingLeft">7.0dip</item>
      <item name="android:paddingTop">6.0dip</item>
      <item name="android:paddingRight">12.0dip</item>
      <item name="android:paddingBottom">5.0dip</item>
      <item name="android:visibility">gone</item>
      <item name="android:layout_width">wrap_content</item>
      <item name="android:layout_height">fill_parent</item>
      <item name="android:src">@drawable/ic_close</item>
      </style>
      <style name="ButtonSearch" parent="@style/LowerCaseTextBtn">
      <item name="android:textSize">15.0sp</item>
      <item name="android:textStyle">bold</item>
      <item name="android:textColor">@color/urlSuggest</item>
      <item name="android:gravity">center</item>
      <item name="android:layout_gravity">center</item>
      <item name="android:background">@drawable/selector_gray_btn</item>
      <item name="android:visibility">gone</item>
      <item name="android:layout_width">wrap_content</item>
      <item name="android:layout_height">wrap_content</item>
      <item name="android:text">@string/SVSearchButton</item>
      </style>-->
      </resource>






      android






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 9 at 10:50









      Kling Klang

      32.1k156287




      32.1k156287










      asked Nov 9 at 10:19









      Spritzig

      340112




      340112





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53223848%2fresource-linking-failed-for-ids-and-public%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53223848%2fresource-linking-failed-for-ids-and-public%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Schultheiß

          Verwaltungsgliederung Dänemarks

          Liste der Kulturdenkmale in Wilsdruff