1/* 2 * Copyright (C) 2010 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package com.android.videoeditor.widgets; 18 19import com.android.videoeditor.R; 20 21import android.content.Context; 22import android.util.AttributeSet; 23import android.view.View; 24import android.widget.RelativeLayout; 25 26/** 27 * The RelativeLayout which is the container for the editor layout. 28 * The only reason we customize this layout is to listen to click events 29 * which will be used to unselect timeline views 30 * (media item views, transition views, ...). 31 */ 32public class EditorRelativeLayout extends RelativeLayout implements View.OnClickListener { 33 /* 34 * {@inheritDoc} 35 */ 36 public EditorRelativeLayout(Context context, AttributeSet attrs, int defStyle) { 37 super(context, attrs, defStyle); 38 39 setOnClickListener(this); 40 } 41 42 public EditorRelativeLayout(Context context, AttributeSet attrs) { 43 this(context, attrs, 0); 44 } 45 46 public EditorRelativeLayout(Context context) { 47 this(context, null, 0); 48 } 49 50 @Override 51 public void onClick(View view) { 52 findViewById(R.id.timeline).setSelected(false); 53 } 54} 55